From 791d21708814f470379c03f9d16d3a6a351cc18a Mon Sep 17 00:00:00 2001 From: andreykurenkov Date: Wed, 5 Aug 2015 19:23:00 -0700 Subject: [PATCH] Revise year listing --- _layouts/post-index.html | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/_layouts/post-index.html b/_layouts/post-index.html index 66bdc7b2..08fbe877 100644 --- a/_layouts/post-index.html +++ b/_layouts/post-index.html @@ -34,16 +34,13 @@

{{ page.title }}

- {% for post in site.posts %} - {% unless post.next %} -

{{ post.date | date: '%Y' }}

- {% else %} - {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} - {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %} - {% if year != nyear %} -

{{ post.date | date: '%Y' }}

- {% endif %} - {% endunless %} + {% capture written_year %}'None'{% endcapture %} + {% for post in site.posts %} + {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} + {% if year != written_year %} +

{{ year }}

+ {% capture written_year %}{{ year }}{% endcapture %} + {% endif %}