From 3f2962cf70d7b0c3549e29e707a4f69d036c5644 Mon Sep 17 00:00:00 2001 From: Philipp Moeller Date: Tue, 31 Mar 2015 17:51:33 +0200 Subject: [PATCH] Use the actual next post in posts_collate Fixes #258 --- _includes/JB/posts_collate | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_includes/JB/posts_collate b/_includes/JB/posts_collate index f612ade871..dd2678f4a4 100644 --- a/_includes/JB/posts_collate +++ b/_includes/JB/posts_collate @@ -23,8 +23,8 @@ Usage: {% for post in posts_collate %} {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} {% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %} - {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %} - {% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %} + {% capture next_year %}{{ posts_collate[forloop.index].date | date: "%Y" }}{% endcapture %} + {% capture next_month %}{{ posts_collate[forloop.index].date | date: "%B" }}{% endcapture %} {% if forloop.first %}

{{this_year}}

@@ -52,4 +52,4 @@ Usage: {% endif %} {% endfor %} {% endif %} -{% assign posts_collate = nil %} \ No newline at end of file +{% assign posts_collate = nil %}