{% load blog_tags %} {% for dates in articles %} {% with dates.pub_date|date:"Y" as year %} {% ifchanged year %} {% if not forloop.first %}{% endif %}
{% is_cur_year blog_year dates "▼,▶" %}  {{ year }} ({% get_articles_count_for_year dates.pub_date %})
{% if not forloop.first %}
{% endif %}
{% endifchanged %} {% with dates.pub_date|date:"F" as month %} {% ifchanged year month %}
{% is_cur_month blog_year blog_month dates "▼,▶" %}  {{ month }} ({% get_articles_count_for_month dates.pub_date %})
{% get_articles_for_month dates.pub_date as articles_list %} {% for article in articles_list %}
{% if blog_article == article %}{% endif %} {{ article }} {% if blog_article == article %}{% endif %}
{% endfor %}
{% endifchanged %} {% endwith %} {% endwith %} {% if forloop.last %}
{% endif %} {% endfor %}