{% for post in site.posts %} {% assign post_year = post.date | date: "%Y" %} {% if post_year != year %} {% unless forloop.first %} {% endunless %}

{{ post_year }}

{% endif %} {% endfor %}