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 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.updated %} + (updated on {{ post.updated | date_to_string }}) + {% endif %} + + + {% 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..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; } @@ -86,3 +85,38 @@ margin-bottom: 2em; margin-top: -2em; } + +.posts hr { + margin: 2rem 0; +} + +@mixin category-posts($color) { + border: 2px solid $color; + border-radius: 10px; + margin-bottom: 2rem; + padding: 1.5rem 1rem; +} + +@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 %} -
-
+
Bare Bones
+
+ {% for post in posts limit:4 %} + {% include post_teaser.html %} + {% endfor %} +
+ +
Memory Management
+
+ {% for post in posts offset:4 limit:2 %} + {% include post_teaser.html %} + {% endfor %} +
+ +
+ {% for post in posts offset:6 %} + {% include post_teaser.html %} {% endfor %}