{% extends 'layout.html' %}


{% set title = 'Archives : Blog' %}

{% block breadcrumbs %}
    <ul id="breadcrumbs">
        <li><a href="{{ get_url() }}">Blog</a></li>
        <li>Archives</li>
    </ul>
{% endblock %}

{% block content %}
    {% for archive in posts.archives|values %}
        <dl class="archives">
            <dt class="archives-year"><a href="{{ get_url(archive.url) }}">{{ archive.year }}</a></dt>
            <dd>
                <dl class="archives-records">
                    {% for month in archive.months|values %}
                        {% for post in month %}
                            <dt class="archives-post-date">{{ post.timestamp|date('%b %d') }}</dt>
                            <dd class="archives-post-title"><a href="{{ get_url(post.url) }}">{{ post.title }}</a></dd>
                            
                            {% if post.tags %}
                                <dd class="archives-post-tags">Tagged <span>»</span> {% for tag in post.tags %}<a href="{{ get_url(posts.tags[tag].url) }}">{{ tag }}</a>{% if not loop.last %}, {% endif %}{% endfor %}</dd>
                            {% endif %}
                        {% endfor %}
                    {% endfor %}
                </dl>
            </dd>
        </dl>
    {% endfor %}
{% endblock %}
