I am using the following theme Documentation – Documentation + help systems theme – Jekyll Themes and have a post in_posts with the following permalink. No other date indication, so I assume the date is taken from the permalink:
---
permalink: 2020-12-04-something-something.html
---
There is a page called news/news_archive.html as such:
<div class="home">
<div class="post-list">
<section id="archive">
<h3>This year's posts</h3>
{%for post in site.posts %}
{% unless post.next %}
<ul class="this">
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
</ul>
<h3>{{ post.date | date: '%Y' }}</h3>
<ul class="past">
{% endif %}
{% endunless %}
<li><time>{{ post.date | date:"%d %b" }}</time><a href="{{ post.url | remove: "/"}}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</section>
<hr/>
</div>
</div>
However, it is 2021 now, the site was last generated/built in 2021 but still in the built website the post is shown under This year’s posts. Why please?
Should it not be visible under another section, namely last year’s posts?
What could be wrong or how can I troubleshoot this? In the original theme’s demo, there is a differentiation between the years:
https://idratherbewriting.com/documentation-theme-jekyll/news_archive.html