{% for post in posts_collate %} {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %} {% if current_year != '' and {{this_year}} != current_year %} {% if forloop.first != true %} {% endif %}

{{ this_year }}

{% endif %} {% assign current_year = {{this_year}} %} {% endfor %} {% assign posts_collate = nil %}