categories.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. {% extends 'base.html' %}
  2. {% block title %}
  3. All Categories · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. All categories of the {{ SITENAME|striptags|e }} blog.
  7. {% endblock head_description %}
  8. {% block meta_tags_in_head %}
  9. {{ super() }}
  10. <meta property="og:title" content="All Categories · {{ SITENAME|striptags|e }}"/>
  11. <meta name="twitter:title" content="All Categories · {{ SITENAME|striptags|e }}">
  12. <meta property="og:url" content="{{ SITEURL }}/categories.html" />
  13. <meta property="og:description" content="All categories of the {{ SITENAME|striptags|e }} blog" />
  14. <meta name="twitter:description" content="All categories of the {{ 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 feed_links %}
  24. {{ super() }}
  25. {% include '_includes/feeds_categories.html' %}
  26. {% endblock feed_links %}
  27. {% block content %}
  28. <div class="row-fluid">
  29. <header class="page-header span10 offset2">
  30. <h1><a href="{{ SITEURL }}/categories.html">All Categories</a></h1>
  31. </header>
  32. </div>
  33. <div class="row-fluid">
  34. <div class="span8 offset2">
  35. <div class="accordion" id="accordion2">
  36. {% for category, articles in categories %}
  37. <div class="accordion-group">
  38. <div class="accordion-heading">
  39. <a class="accordion-toggle list-of-categories" data-toggle="collapse" data-parent="#accordion2" href="#{{ category.slug }}-ref">
  40. {% set num = articles|count %}
  41. {{ category }}<span>{{ num }}</span>
  42. </a>
  43. </div>
  44. <div id="{{ category.slug }}-ref" class="accordion-body collapse">
  45. <div class="accordion-inner">
  46. <ul class="list-articles-category">
  47. {% for article in articles %}
  48. <li><time pubdate="pubdate" datetime="{{ article.date.isoformat() }}">{{ article.locale_date }}</time><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }} {%if article.subtitle %} <small> {{ article.subtitle }} </small> {% endif %} </a></li>
  49. {% endfor %}
  50. </ul>
  51. </div>
  52. </div>
  53. </div>
  54. {% endfor %}
  55. </div>
  56. </div>
  57. </div>
  58. {% endblock content %}
  59. {% block script %}
  60. {{ super() }}
  61. <script language="javascript" type="text/javascript">
  62. function uncollapse() {
  63. $(window.location.hash).collapse({
  64. toggle: true
  65. })
  66. }
  67. </script>
  68. <script type="text/javascript" language="JavaScript">
  69. uncollapse();
  70. </script>
  71. {% endblock script %}