{% for post in site.posts limit:include.post-limit | default:500 %}

{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}

{% if forloop.first %}

<h2 class="c-lh-title mt4 mb2 f4">{{ this_year }}</h2>

<ul class="ma0 pa0 list">

{% endif %}

    <li><a class="db" href="{{ post.url }}">{{ post.title }}</a><time class="db mb2 f6">{{ post.date | date: "%-d %b" }}</time></li>

{% if forloop.last %}

</ul>

{% else %}

    {% if this_year != next_year %}

    </ul>

    <h2 class="c-lh-title mt4 mb2 f4">{{next_year}}</h2>

    <ul class="ma0 pa0 list">

    {% endif %}

{% endif %}

{% endfor %}