Created
June 5, 2014 15:35
-
-
Save gorka/c44ca61b27ac6304bad5 to your computer and use it in GitHub Desktop.
Archivo por años para Jekyll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section id="archive"> | |
<h2>Posts escritos este año</h2> | |
{%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> | |
<h2>{{ post.date | date: '%Y' }}</h2> | |
<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