{% if page.type %}

{{ page.type }}

{% else %}
{% for post in site.posts %} {% unless post.next %}

{{ post.date | date: '%Y' }}

{% else %} {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %} {% capture nextyear %}{{ post.next.date | date: '%Y' }}{% endcapture %} {% if year != nextyear %}

{{ post.date | date: '%Y' }}

{% endif %} {% endunless %} {% endfor %}
{% endif %}