archives.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {% extends 'base.html' %}
  2. {% block title %}
  3. All Posts · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. Full archives of {{ SITENAME|striptags|e }} blog.
  7. {% endblock head_description %}
  8. {% block meta_tags_in_head %}
  9. {{ super() }}
  10. <meta property="og:title" content="All Posts · {{ SITENAME|striptags|e }}"/>
  11. <meta name="twitter:title" content="All Posts · {{ SITENAME|striptags|e }}">
  12. <meta property="og:url" content="{{ SITEURL }}/archives.html" />
  13. <meta property="og:description" content="Full archives of {{ SITENAME|striptags|e }} blog" />
  14. <meta name="twitter:description" content="Full archives of {{ SITENAME|striptags|e }} blog">
  15. <meta property="og:site_name" content="{{ SITENAME|striptags|e }}" />
  16. <meta property="og:article:author" content="{{ AUTHOR }}" />
  17. {% from '_includes/_defaults.html' import FEATURED_IMAGE with context %}
  18. {% if FEATURED_IMAGE %}
  19. <meta property="og:image" content="{{FEATURED_IMAGE}}" />
  20. <meta name="twitter:image" content="{{FEATURED_IMAGE}}" >
  21. {% endif %}
  22. {% endblock meta_tags_in_head %}
  23. {% block content %}
  24. <div class="row-fluid">
  25. <header class="page-header span10 offset2">
  26. <h1><a href="{{ SITEURL }}/archives.html">All Posts</a></h1>
  27. </header>
  28. </div>
  29. <div class="row-fluid">
  30. <div class="span10 offset2">
  31. <div class="blog-archives">
  32. {% set last_year = 0 %}
  33. {% for article in dates %}
  34. {% set year = article.date.strftime('%Y') %}
  35. {%if last_year != year %}
  36. <h2 id="{{year }}"><a href="#{{year}}">{{ year }}</a></h2>
  37. {% set last_year = year %}
  38. {% endif %}
  39. {% set next_year = 0 %}
  40. {% if not loop.last %}
  41. {% set next = loop.index0 + 1 %}
  42. {% set next_article = dates[next] %}
  43. {% set next_year = next_article.date.strftime('%Y') %}
  44. {% endif %}
  45. {% if next_year != year %}
  46. <article class="last-entry-of-year">
  47. {% else %}
  48. <article>
  49. {% endif %}
  50. <a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a>
  51. <time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time>
  52. </article>
  53. {% endfor %}
  54. </div>
  55. </div>
  56. </div>
  57. {% endblock content %}