Begin to implement index@2017

This commit is contained in:
Rico Sta. Cruz 2017-08-28 23:14:30 +08:00
parent 0a5a6d30cc
commit 8a37f1874f
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
11 changed files with 129 additions and 11 deletions

View File

@ -6,6 +6,8 @@
<div class='actions'>
{% include social-list.html class="social page-actions" page=include.page %}
{% if include.page.type == 'article' %}
<ul class='page-actions'>
<li class='link github -button hint--bottom' data-hint='Edit this page on GitHub'>
<a href='https://github.com/rstacruz/cheatsheets/blob/gh-pages/{{ page.path | remove: '.html' }}'>
@ -13,6 +15,7 @@
</a>
</li>
</ul>
{% endif %}
</div>
</div>
</div>

33
_layouts/2017/home.html Normal file
View File

@ -0,0 +1,33 @@
---
type: website
---
{% include 2017/head.html %}
{% include 2017/top-nav.html page=page %}
<div class='body-area -slim'>
<div class='search-box'>
<input type='text' placeholder='Search...' />
</div>
<div class='pages-list'>
{% for category in site.category_names %}
<h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}'>
<span>{{ category }}</span>
</h2>
{% for page in site.pages %}
{% if page.category == category %}
{% if page.type == article %}
<a class='article item' href="{{base}}{{ page.url | remove: '.html' }}">
<code class='slug'>{{ page.url | remove: '.html' | remove: '/' }}</code>
<span class='title'>{{ page.title }}</span>
</a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% include 2017/foot.html %}

View File

@ -11,11 +11,13 @@ html_class: home
<div class='pages-list'>
{% for page in site.pages %}
{% if page.category == category %}
{% if page.type == article %}
<a href="{{base}}{{ page.url | remove: '.html' }}">
<span class='title'>{{ page.title }}</span>
<span class='date'>{{ page.url | remove: '.html' | remove: '/' }}</span>
</a>
{% endif %}
{% endif %}
{% endfor %}
</div>
{% endfor %}

View File

@ -2,4 +2,8 @@
max-width: $area-width;
margin: 0 auto;
@include gutter(padding);
&.-slim {
max-width: 600px;
}
}

View File

@ -58,6 +58,10 @@
@include action-bar;
}
& + & {
margin-left: 8px;
}
& > .facebook > a::before {
@include ion-icon('logo-facebook');
}
@ -75,10 +79,17 @@
border-radius: 2px;
padding: 0 16px;
margin: 0 8px;
transition: all 100ms linear;
& > .text {
margin-left: 4px;
}
&:hover,
&:focus {
background: $base-panel;
box-shadow: $shadow3;
}
}
// Collapse

View File

@ -0,0 +1,55 @@
.search-box {
background: $base-panel;
box-shadow: $shadow3;
& > input {
padding: 16px;
background: transparent;
border: 0;
width: 100%;
}
}
.pages-list {
> .item {
border-top: solid 1px $dark-line-color;
padding: 4px 0;
}
> .article {
text-decoration: none;
display: block;
white-space: nowrap;
padding-left: 8px;
&,
&:visited {
color: $base-mute;
}
&:hover,
&:focus {
& > code {
color: $base-a;
}
}
& > code {
color: $base-head;
}
& > .title::before {
content: '/ ';
margin: 0 8px;
color: $base-mute;
opacity: 0.5;
}
}
> .category {
@include font-size(1);
margin: 0;
font-weight: normal;
color: $base-b;
}
}

View File

@ -4,6 +4,7 @@
height: 48px;
line-height: 48px;
text-align: center;
overflow: hidden;
}
>.container {

View File

@ -17,4 +17,5 @@
@import './components/headline-ad';
@import './components/main-heading';
@import './components/page-actions';
@import './components/pages-list';
@import './components/top-nav';

6
index@2017.md Normal file
View File

@ -0,0 +1,6 @@
---
full_title: "Cheatsheets — for web development and more"
description: "A collection of cheatsheets I've written."
layout: 2017/home
type: website
---

View File

@ -3,6 +3,7 @@ title: React.js
category: React
layout: 2017/sheet
ads: true
tags: [Featured]
---
{%raw%}

1
vim.md
View File

@ -2,6 +2,7 @@
title: Vim
category: Vim
layout: 2017/sheet
tags: [Featured]
---
Getting started