From 2efafc48ca137a71f0e2e1589d7fb4123439687e Mon Sep 17 00:00:00 2001 From: jluccisano Date: Sun, 12 Feb 2017 17:22:00 +0100 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 %}