jekyll-bootstrap icon indicating copy to clipboard operation
jekyll-bootstrap copied to clipboard

posts_collate shows wrong year and month for sub sets of posts

Open bo0ts opened this issue 10 years ago • 1 comments

When collating a subset of a tag with:

{% assign posts_collate = site.tags.WIP %}
{% include JB/posts_collate %}

the generated list will not show the correct month and year when the posts which are not in the subset cross the month or year boundary.

As far as I can tell this is caused by the following code in posts_collate:

{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}

post.previous is not the actual previous post in a subset. The correct previous post would be the next post in the array.

bo0ts avatar Mar 31 '15 15:03 bo0ts

Based on your description, the fix seems sound. I'll do some testing to verify (all posts, subset of posts, ...) then incorporate your changes if all seems well or report back using this issue if I see any problems.

Thanks for the contribution!

groundh0g avatar Apr 01 '15 01:04 groundh0g