---
layout: post-index
title: All Posts
excerpt: A List of Posts
image:
  feature: features/paul-van-dyk.jpg
  credit: Miha Rekar - Paul van Dyk @ Ultra 2014
  creditlink: http://mr.si/
---

<h1>{{ page.title }}</h1>
{% for post in site.categories.posts %}
{% unless post.next %}
  <h3>{{ post.date | date: '%Y' }}</h3>
  {% else %}
    {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
    {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
    {% if year != nyear %}
      <h3>{{ post.date | date: '%Y' }}</h3>
    {% endif %}
  {% endunless %}
  <article>
    {% if post.link %}
      <h2 class="link-post"><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
    {% else %}
      <h2><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
      <p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
    {% endif %}
  </article>
{% endfor %}

---
layout: post-index
title: All Posts
excerpt: A List of Posts
image:
  feature: features/paul-van-dyk.jpg
  credit: Miha Rekar - Paul van Dyk @ Ultra 2014
  creditlink: http://mr.si/
---

<h1>{{ page.title }}</h1>
{% for post in site.categories.posts %}
  {% capture current_year %}{{ post.date | date: '%Y' }}{% endcapture %}
  {% if current_year != previous_year %}
    <h3>{{ post.date | date: '%Y' }}</h3>
  {% endif %}
  {% capture previous_year %}{{ post.date | date: '%Y' }}{% endcapture %}
  <article>
    {% if post.link %}
      <h2 class="link-post"><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> <a href="{{ post.link }}" target="_blank" title="{{ post.title }}"><i class="fa fa-link"></i></a></h2>
    {% else %}
      <h2><a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a></h2>
      <p>{{ post.excerpt | strip_html | truncate: 160 }}</p>
    {% endif %}
  </article>
{% endfor %}

Fix years since .next doesn't work correctly with categories
Fix years since .next doesn't work correctly with categories
