archives.html 2.4 KB

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