{% load i18n wagtailroutablepage_tags %}

<nav>
    <ul>
        {% regroup archives by year as year_list %}
        {% for year in year_list %}
            <li class="parent">
                <a href="{% routablepageurl blog_page "entries_by_date" year.grouper %}">
                    <span class="open-sub"></span> {{ year.grouper }}
                </a>
                <ul class="sub">
                    {% regroup year.list by month as month_list %}
                    {% for month in month_list reversed %}
                        <li>
                            <a href="{% routablepageurl blog_page "entries_by_date" year.grouper month.list.0|date:"m" %}">
                               {{ month.list.0|date:"F" }}
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            </li>
            {% empty %}
            {% trans 'No entry archives yet' %}
        {% endfor %}
    </ul>
</nav>


