Skip to content

Commit

Permalink
Use the actual next post in posts_collate
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Moeller committed Mar 31, 2015
1 parent 3481cfa commit 3f2962c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _includes/JB/posts_collate
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
<h2>{{this_year}}</h2>
Expand Down Expand Up @@ -52,4 +52,4 @@ Usage:
{% endif %}
{% endfor %}
{% endif %}
{% assign posts_collate = nil %}
{% assign posts_collate = nil %}

0 comments on commit 3f2962c

Please # to comment.