Correction in the archives

Now the posts are correctly grouped by year.
This commit is contained in:
Natalia Ventre
2012-02-08 23:30:19 -02:00
parent 2790cccdd9
commit 385da5723d

View File

@@ -1,21 +1,18 @@
{% extends "base.html" %}
{% block title %}{{ SITENAME }} <small>[archive]</small>{% endblock %}
{% block title %}{{ SITENAME }}{% endblock %}
{% block content %}
<div role="main" class="content clearfix">
<div class="wrapper main">
{% for year, date_year in dates|groupby( 'date.year' ) %}
<h2>{{ year }}</h2>
{% for month, articles in date_year|groupby( 'date.month' ) %}
<h3>{{ articles[ 0 ].date.strftime( '%B' ) }}</h3>
<h2>{{ year }}</h2>
<ol class="archive">
{% for article in articles %}
{% for article in date_year %}
<li class="clearfix"><a href="{{ article.url }}"><time datetime="{{ article.date.isoformat() }}" pubdate>{{ article.locale_date }}</time> {{ article.title }}</a></li>
{% endfor %}
</ol>
{% endfor %}
{% endfor %}
</div>
</div>
{% endblock %}