jon-e.net/_pages/posts.md

1.6 KiB

layout title permalink
default Posts /posts/

{{ page.title }}

{% for post in site.posts -%} {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture -%} {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%} {% if forloop.first %}{{ this_year }}{% endif -%} {% unless forloop.last -%} {% if this_year != next_year %}{{ next_year }}{% endif -%} {% endunless -%} {% endfor -%}
{% for post in site.posts -%} {% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture -%} {% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture -%} {% if forloop.first -%}

{{ this_year }}

{% endif -%}
{{ post.title }}
{% if forloop.last -%}
{% else -%} {% if this_year != next_year -%}

{{ next_year }}

{% endif -%} {% endif -%} {% endfor -%}