From 0498eb167cf7195ca1706df5efe740a0a8904fd8 Mon Sep 17 00:00:00 2001 From: andreykurenkov Date: Wed, 5 Aug 2015 19:23:00 -0700 Subject: [PATCH] Revised year listing that is more robust to changes- --- _layouts/post-index.html | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/_layouts/post-index.html b/_layouts/post-index.html index 814f7e95e4cd..fe030ac20ea0 100644 --- a/_layouts/post-index.html +++ b/_layouts/post-index.html @@ -34,16 +34,13 @@

{{ page.title }}

+ {% capture written_year %}'None'{% endcapture %} {% 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 year %}{{ post.date | date: '%Y' }}{% endcapture %} + {% if year != written_year %} +

{{ year }}

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