From 8a37f1874f861d04c751e5037fa1193479b72816 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 28 Aug 2017 23:14:30 +0800 Subject: [PATCH] Begin to implement index@2017 --- _includes/2017/top-nav.html | 17 ++++---- _layouts/2017/home.html | 33 +++++++++++++++ _layouts/home.html | 10 +++-- _sass/2017/components/body-area.scss | 4 ++ _sass/2017/components/page-actions.scss | 11 +++++ _sass/2017/components/pages-list.scss | 55 +++++++++++++++++++++++++ _sass/2017/components/top-nav.scss | 1 + _sass/2017/style.scss | 1 + index@2017.md | 6 +++ react.md | 1 + vim.md | 1 + 11 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 _layouts/2017/home.html create mode 100644 _sass/2017/components/pages-list.scss create mode 100644 index@2017.md diff --git a/_includes/2017/top-nav.html b/_includes/2017/top-nav.html index 533067720..027287052 100644 --- a/_includes/2017/top-nav.html +++ b/_includes/2017/top-nav.html @@ -6,13 +6,16 @@
{% include social-list.html class="social page-actions" page=include.page %} - + + {% if include.page.type == 'article' %} + + {% endif %}
diff --git a/_layouts/2017/home.html b/_layouts/2017/home.html new file mode 100644 index 000000000..25aecfceb --- /dev/null +++ b/_layouts/2017/home.html @@ -0,0 +1,33 @@ +--- +type: website +--- +{% include 2017/head.html %} + +{% include 2017/top-nav.html page=page %} + +
+ + +
+ {% for category in site.category_names %} +

+ {{ category }} +

+ + {% for page in site.pages %} + {% if page.category == category %} + {% if page.type == article %} + + {{ page.url | remove: '.html' | remove: '/' }} + {{ page.title }} + + {% endif %} + {% endif %} + {% endfor %} + {% endfor %} +
+
+ +{% include 2017/foot.html %} diff --git a/_layouts/home.html b/_layouts/home.html index 71aed9300..bcfec4ca4 100644 --- a/_layouts/home.html +++ b/_layouts/home.html @@ -11,10 +11,12 @@ html_class: home
{% for page in site.pages %} {% if page.category == category %} - - {{ page.title }} - {{ page.url | remove: '.html' | remove: '/' }} - + {% if page.type == article %} + + {{ page.title }} + {{ page.url | remove: '.html' | remove: '/' }} + + {% endif %} {% endif %} {% endfor %}
diff --git a/_sass/2017/components/body-area.scss b/_sass/2017/components/body-area.scss index 4b8fdaed9..255a02ae4 100644 --- a/_sass/2017/components/body-area.scss +++ b/_sass/2017/components/body-area.scss @@ -2,4 +2,8 @@ max-width: $area-width; margin: 0 auto; @include gutter(padding); + + &.-slim { + max-width: 600px; + } } diff --git a/_sass/2017/components/page-actions.scss b/_sass/2017/components/page-actions.scss index 834eb933a..232e41127 100644 --- a/_sass/2017/components/page-actions.scss +++ b/_sass/2017/components/page-actions.scss @@ -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 diff --git a/_sass/2017/components/pages-list.scss b/_sass/2017/components/pages-list.scss new file mode 100644 index 000000000..9f89ff5de --- /dev/null +++ b/_sass/2017/components/pages-list.scss @@ -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; + } +} diff --git a/_sass/2017/components/top-nav.scss b/_sass/2017/components/top-nav.scss index 1352a5bec..bb109520f 100644 --- a/_sass/2017/components/top-nav.scss +++ b/_sass/2017/components/top-nav.scss @@ -4,6 +4,7 @@ height: 48px; line-height: 48px; text-align: center; + overflow: hidden; } >.container { diff --git a/_sass/2017/style.scss b/_sass/2017/style.scss index 19b032808..5a0d8aa29 100644 --- a/_sass/2017/style.scss +++ b/_sass/2017/style.scss @@ -17,4 +17,5 @@ @import './components/headline-ad'; @import './components/main-heading'; @import './components/page-actions'; +@import './components/pages-list'; @import './components/top-nav'; diff --git a/index@2017.md b/index@2017.md new file mode 100644 index 000000000..716c5b115 --- /dev/null +++ b/index@2017.md @@ -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 +--- diff --git a/react.md b/react.md index f772015d6..f8a5b7b68 100644 --- a/react.md +++ b/react.md @@ -3,6 +3,7 @@ title: React.js category: React layout: 2017/sheet ads: true +tags: [Featured] --- {%raw%} diff --git a/vim.md b/vim.md index e83bca766..71f1b5c31 100644 --- a/vim.md +++ b/vim.md @@ -2,6 +2,7 @@ title: Vim category: Vim layout: 2017/sheet +tags: [Featured] --- Getting started