{% extends "base.html" %} {% block title %}{{ SITENAME }} | Archives{% endblock %} {% block content %}

Archives

{# based on http://stackoverflow.com/questions/12764291/jinja2-group-by-month-year #} {% for year, year_group in dates|groupby('date.year')|reverse %} {% for month, month_group in year_group|groupby('date.month')|reverse %}

{{ (month_group|first).date|strftime('%b %Y') }}

{% endfor %} {% endfor %} {% endblock %}