From f0cf691229d02cd52182b4be2ba1ebc934d4b7a9 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 17 Dec 2015 02:22:21 +0100 Subject: [PATCH 1/3] Disable pagination --- _config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/_config.yml b/_config.yml index 6b31efbe..c975528f 100644 --- a/_config.yml +++ b/_config.yml @@ -8,7 +8,6 @@ relative_permalinks: true title: phil-opp's blog full_title: Writing an OS in Rust tagline: Philipp Oppermann's blog -paginate: 10 baseurl: "" url: http://os.phil-opp.com From 5f8b058cd364348843631d1ed831364a39498901 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 17 Dec 2015 02:28:41 +0100 Subject: [PATCH 2/3] Add `bare bones` and `memory management` categories --- _includes/post_teaser.html | 23 ++++++++++++++++++++++ _sass/_posts.scss | 30 ++++++++++++++++++++++++++++ index.html | 40 +++++++++++++++++--------------------- 3 files changed, 71 insertions(+), 22 deletions(-) create mode 100644 _includes/post_teaser.html diff --git a/_includes/post_teaser.html b/_includes/post_teaser.html new file mode 100644 index 00000000..aafb2c0b --- /dev/null +++ b/_includes/post_teaser.html @@ -0,0 +1,23 @@ +
+

+ + {{ post.title }} + +

+ + + + {% if post.content contains '' %} + {{ post.content | split:'' | first }} + {% else %} + {{ post.excerpt }} + {% endif %} +
+{% if forloop.last == false %} +
+{% endif %} diff --git a/_sass/_posts.scss b/_sass/_posts.scss index 75ab451c..5ed60ee9 100644 --- a/_sass/_posts.scss +++ b/_sass/_posts.scss @@ -86,3 +86,33 @@ margin-bottom: 2em; margin-top: -2em; } + +@mixin category-posts($color) { + border: 2px solid $color; + border-radius: 5px; + margin-bottom: 2rem; +} + +@mixin category-title($color) { + color: $color; + margin-right: 0.5rem; + text-transform: uppercase; + font-size: 0.8rem; + text-align: right; +} + +.posts.bare-bones { + @include category-posts(#99f); +} + +.post-category.bare-bones { + @include category-title(#66f); +} + +.posts.memory-management { + @include category-posts(#cc0); +} + +.post-category.memory-management { + @include category-title(#990); +} diff --git a/index.html b/index.html index 50a7f0ed..64b62054 100644 --- a/index.html +++ b/index.html @@ -13,28 +13,24 @@ title: Home {% endfor %} -
- {% for post in site.posts reversed %} -
-

- - {{ post.title }} - -

+{% assign posts = site.posts | reverse %} - - - {% if post.content contains '' %} - {{ post.content | split:'' | first }} - {% else %} - {{ post.excerpt }} - {% endif %} -
-
+ +
+ {% for post in posts limit:4 %} + {% include post_teaser.html %} + {% endfor %} +
+ + +
+ {% for post in posts offset:4 limit:2 %} + {% include post_teaser.html %} + {% endfor %} +
+ +
+ {% for post in posts offset:6 %} + {% include post_teaser.html %} {% endfor %}
From 6cccace846faea78bc2312273e6dbbc41adaa04f Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 17 Dec 2015 02:29:34 +0100 Subject: [PATCH 3/3] Tweak margins --- _sass/_posts.scss | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/_sass/_posts.scss b/_sass/_posts.scss index 5ed60ee9..2150d7e5 100644 --- a/_sass/_posts.scss +++ b/_sass/_posts.scss @@ -3,8 +3,7 @@ // Each post is wrapped in `.post` and is used on default and post layouts. Each // page is wrapped in `.page` and is only used on the page layout. -.page, -.post { +.page { margin-bottom: 4em; } @@ -87,10 +86,15 @@ margin-top: -2em; } +.posts hr { + margin: 2rem 0; +} + @mixin category-posts($color) { border: 2px solid $color; - border-radius: 5px; + border-radius: 10px; margin-bottom: 2rem; + padding: 1.5rem 1rem; } @mixin category-title($color) {