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..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 %} -
-
+
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 %}