You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

41 lines
1.3 KiB

---
layout: default
title : Archive
---
<section id="archive">
{% assign posts_collate = site.posts %}
{% for post in posts_collate %}
{% capture this_year %}{{ post.date | date: "%Y" }}{% endcapture %}
{% capture this_month %}{{ post.date | date: "%B" }}{% endcapture %}
{% capture this_month_num %}{{ post.date | date: "%m" }}{% endcapture %}
{% capture next_year %}{{ post.previous.date | date: "%Y" }}{% endcapture %}
{% capture next_month %}{{ post.previous.date | date: "%B" }}{% endcapture %}
{% if forloop.first %}
<h1 id="{{this_year}}">{{this_year}}</h1>
<h3 id ="{{this_year}}:{{this_month_num}}">{{this_month}}</h3>
<ul>
{% endif %}
<li id="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %e, %Y" }} &raquo; <a href="{{ BASE_PATH }}{{ post.url }}">{{ post.title }}</a></li>
{% if forloop.last %}
</ul>
{% else %}
{% if this_year != next_year %}
</ul>
<h1 id="{{ next_year }}">{{next_year}}</h1>
<h3 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h3>
<ul>
{% else %}
{% if this_month != next_month %}
</ul>
<h3 id="{{ next_year }}:{{ next_month }}">{{next_month}}</h3>
<ul>
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% assign posts_collate = nil %}
</section>