Skip to content

Instantly share code, notes, and snippets.

@gandhiShepard
Forked from rey/archive.html
Created August 30, 2014 15:54
Show Gist options
  • Save gandhiShepard/e087ec037bb21ff86ee5 to your computer and use it in GitHub Desktop.
Save gandhiShepard/e087ec037bb21ff86ee5 to your computer and use it in GitHub Desktop.
<section id="archive">
<h3>This year's posts</h3>
{%for post in site.posts %}
{% unless post.next %}
<ul class="this">
{% else %}
{% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
{% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
{% if year != nyear %}
</ul>
<h3>{{ post.date | date: '%Y' }}</h3>
<ul class="past">
{% endif %}
{% endunless %}
<li><time>{{ post.date | date:"%d %b" }}</time><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
</section>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment