Skip to content

Instantly share code, notes, and snippets.

@madhur
Created December 30, 2011 07:37
Show Gist options
  • Save madhur/1538504 to your computer and use it in GitHub Desktop.
Save madhur/1538504 to your computer and use it in GitHub Desktop.
Archive
---
layout: page
title: Archive
permalink: /archive/
---
<div id="archive">
{% for post in site.posts %}
{% capture tmp_year %}{{ post.date|date:'%Y' }}{% endcapture %}
{% if year != tmp_year %}
{% assign year = tmp_year %}
<h2 class="year">{{ year }}</h2>
{% endif %}
{% capture tmp_month %}{{ post.date|date:'%B' }}{% endcapture %}
{% if month != tmp_month %}
{% assign month = tmp_month %}
<h3 class="month">{{ month }}</h3>
{% endif %}
<div class="archive-link">
<span class="archive-date">{{ post.date|date:'%d' }}</span>
<a href="{{ post.url }}">{{ post.title }}</a>
</div>
{% endfor %}
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment