From d0bf3106c80943c869144e08389801ad151b6567 Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 26 Feb 2014 15:48:56 -0500 Subject: [PATCH] Group all posts by year --- posts.html | 34 ++++++++++++++++++++++------------ tags.html | 2 +- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/posts.html b/posts.html index bbb1606..658f54b 100644 --- a/posts.html +++ b/posts.html @@ -6,17 +6,27 @@ description: "An archive of posts." --- {% for post in site.posts %} -
-
- - {% if post.link %} -

{{ post.title }}

- {% else %} -

{{ post.title }}

+ {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} + {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} + + {% if forloop.first %} +
+

{{ this_year }}

+ +
+ {% else %} + {% if this_year != next_year %} + +
+
+

{{next_year}}

+
{% endfor %} \ No newline at end of file diff --git a/tags.html b/tags.html index ffa16b4..42a3a5c 100644 --- a/tags.html +++ b/tags.html @@ -20,7 +20,7 @@ description: "An archive of posts sorted by tag." {% for tag in site.tags %} -
+

{{ tag[0] }}

    {% assign pages_list = tag[1] %}