{% macro render(posts) %} {%- set current_year = '1970' %} {%- for post in posts.toArray() %} {%- set year = date(post.date, 'YYYY') %} {%- if year !== current_year %} {%- set current_year = year %}
{{ current_year }}
{%- endif %}
{%- if post.link %}{# Link posts #} {%- set postTitleIcon = '' %} {%- set postText = post.title or post.link %} {{ next_url(post.link, postText + postTitleIcon, {class: 'post-title-link post-title-link-external', itemprop: 'url'}) }} {% else %} {%- endif %}
{%- endfor %} {% endmacro %}