diff options
author | Patrick Spek <p.spek@tyil.nl> | 2020-06-10 11:53:04 +0200 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2020-06-10 11:53:04 +0200 |
commit | d9bdc2d9d5136b3473525c4db015c133667bb05d (patch) | |
tree | 9fbe41e918a623a40d309abb8c4e90a83b6fbc94 /_layouts/archive.html | |
parent | 1e658c4b99b5260fd5c908e35abf9dd36ffff897 (diff) |
Redo the blog post list logic
Diffstat (limited to '_layouts/archive.html')
-rw-r--r-- | _layouts/archive.html | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/_layouts/archive.html b/_layouts/archive.html index 4c30f96..c794c22 100644 --- a/_layouts/archive.html +++ b/_layouts/archive.html @@ -10,10 +10,13 @@ layout: default {% for post in page.posts %} {% if post.wip %}{% continue %}{% endif %} - {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} - {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} + {% assign this_year = post.date | date: "%Y" %} + + {% if this_year != prev_year %} + {% if forloop.first != true %} + </ul> + {% endif %} - {% if forloop.first %} <h3>{{ this_year }}</h3> <ul> {% endif %} @@ -30,11 +33,7 @@ layout: default {% if forloop.last %} </ul> - {% else %} - {% if this_year != next_year %} - </ul> - <h3>{{ next_year }}</h3> - <ul> - {% endif %} {% endif %} + + {% assign prev_year = post.date | date: "%Y" %} {% endfor %} |