{% load blog_tags %} {% for dates in articles %} {% with dates.pub_date|date:"Y" as year %} {% ifchanged year %} {% if not forloop.first %}{% endif %}