jekyll-bootstrap
jekyll-bootstrap copied to clipboard
posts_collate shows wrong year and month for sub sets of posts
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.
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!