Skip to content

Instantly share code, notes, and snippets.

@nukos
Created January 31, 2015 15:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nukos/c5de1518b3a3f8ab93d4 to your computer and use it in GitHub Desktop.
Save nukos/c5de1518b3a3f8ab93d4 to your computer and use it in GitHub Desktop.
Jekyll for archive list
{% for post in site.posts %}
{% capture month %}{{ post.date | date: '%m%Y' }}{% endcapture %}
{% capture nmonth %}{{ post.next.date | date: '%m%Y' }}{% endcapture %}
{% if month != nmonth %}
<li class="list-item">
<a href="/{{ post.date | date: '%Y/%m/' }}">
<span class="item-year" title="{{ post.date | date: '%Y年' }}">{{ post.date | date: '%Y' }}</span>
<span class="item-month" title="{{ post.date | date: '%m月' }}">{{ post.date | date: '%m' }}</span>
</a>
</li>
{% endif %}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment