archives.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. {% extends 'base.html' %}
  2. {% block title %}
  3. All Posts · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. Full archives of {{ SITENAME|striptags }} blog.
  7. {% endblock head_description %}
  8. {% block content %}
  9. <div class="row-fluid">
  10. <header class="page-header span10 offset2">
  11. <h1><a href="{{ SITEURL }}/archives.html">All Posts</a></h1>
  12. </header>
  13. </div>
  14. <div class="row-fluid">
  15. <div class="span10 offset2">
  16. <div class="blog-archives">
  17. {% set last_year = 0 %}
  18. {% for article in dates %}
  19. {% set year = article.date.strftime('%Y') %}
  20. {%if last_year != year %}
  21. <h2 id="{{year }}"><a href="#{{year}}">{{ year }}</a></h2>
  22. {% set last_year = year %}
  23. {% endif %}
  24. {% set next_year = 0 %}
  25. {% if not loop.last %}
  26. {% set next = loop.index0 + 1 %}
  27. {% set next_article = dates[next] %}
  28. {% set next_year = next_article.date.strftime('%Y') %}
  29. {% endif %}
  30. {% if next_year != year %}
  31. <article class="last-entry-of-year">
  32. {% else %}
  33. <article>
  34. {% endif %}
  35. <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a>
  36. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
  37. </article>
  38. {% endfor %}
  39. </div>
  40. </div>
  41. </div>
  42. {% endblock content %}