summaryrefslogtreecommitdiff
path: root/_site_build
diff options
context:
space:
mode:
authordavidtsadler <davidtsadler@googlemail.com>2012-01-07 22:13:25 +0000
committerdavidtsadler <davidtsadler@googlemail.com>2012-01-07 22:13:25 +0000
commit44a4b6a3f2ffb871a05ba9afe46901ec8b65fa36 (patch)
treeaa3ce3418108d0e7dc5f36b3457dd142f635a90f /_site_build
parentf59e8e63993f4410839fa90ac5df859abb4015c8 (diff)
Show archives by month as well as year.
Diffstat (limited to '_site_build')
-rw-r--r--_site_build/archives/index.html29
1 files changed, 17 insertions, 12 deletions
diff --git a/_site_build/archives/index.html b/_site_build/archives/index.html
index 721e66a..45272d0 100644
--- a/_site_build/archives/index.html
+++ b/_site_build/archives/index.html
@@ -5,23 +5,28 @@ robots: follow, noindex, noodp, noydir
---
<section id="archives">
<h1>Archives</h1>
+ {% assign show_year = true %}
+ {% assign show_month = true %}
{% for post in site.posts %}
- {% unless post.next %}
+ {% if show_year %}
<h2>{{ post.date | date: '%Y' }}</h2>
+ {% endif %}
+ {% if show_year or show_month %}
+ <h3>{{ post.date | date: '%B' }}</h3>
<ol>
- {% else %}
- {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
- {% capture nyear %}{{ post.next.date | date: '%Y' }}{% endcapture %}
- {% if year != nyear %}
- </ol>
- <h2>{{ post.date | date: '%Y' }}</h2>
- <ol>
- {% endif %}
- {% endunless %}
+ {% endif %}
<li>
- <time datetime="{{ post.date | date: '%Y-%m-%d' }}" pubdate>{{ post.date | date: '%b' }} {{ post.date | ordinalize }}</time> <a href="{{ post.url }}" rel="bookmark" target="_self" title="{{ post.title }}">{{ post.title }}</a>
+ <a href="{{ post.url }}" target="_self" title="{{ post.title }}">{{ post.title }}</a>
</li>
+ {% capture year %}{{ post.date | date: '%Y' }}{% endcapture %}
+ {% capture pyear %}{{ post.previous.date | date: '%Y' }}{% endcapture %}
+ {% capture month %}{{ post.date | date: '%B' }}{% endcapture %}
+ {% capture pmonth %}{{ post.previous.date | date: '%B' }}{% endcapture %}
+ {% if year != pyear %}{% assign show_year = true %}{% else %}{% assign show_year = false %}{% endif %}
+ {% if month != pmonth %}{% assign show_month = true %}{% else %}{% assign show_month = false %}{% endif %}
+ {% if show_year or show_month %}
+ </ol>
+ {% endif %}
{% endfor %}
- </ol>
</section>