categories.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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">
  29. <header class="page-header col-md-10 col-md-offset-2">
  30. <h1><a href="{{ SITEURL }}/categories.html">All Categories</a></h1>
  31. </header>
  32. </div>
  33. <div class="row">
  34. <div class="col-md-8 col-md-offset-2">
  35. <div class="panel-group" id="accordion role="tablist" aria-multiselectable="true"">
  36. {% for category, articles in categories %}
  37. {% set collapse_id = category.slug + '-ref' %}
  38. {% set collapse_ref = '#' + collapse_id %}
  39. {% set heading_id = 'heading-' + category.slug %}
  40. <div class="panel panel-default">
  41. <div class="panel-heading" role="tab" id="{{ heading_id }}">
  42. <a class="panel-title list-of-categories collapsed" data-toggle="collapse" data-parent="#accordion" href="{{ collapse_ref }}" aria-expanded="false" aria-controls="{{ collapse_id }}">
  43. {% set num = articles|count %}
  44. {{ category }}<span>{{ num }}</span>
  45. </a>
  46. </div>
  47. <div id="{{ collapse_id }}" class="panel-collapse collapse" role="tabpanel" aria-labelledby="{{ heading_id }}">
  48. <div class="panel-body">
  49. <ul class="list-articles-category">
  50. {% for article in articles %}
  51. <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>
  52. {% endfor %}
  53. </ul>
  54. </div>
  55. </div>
  56. </div>
  57. {% endfor %}
  58. </div>
  59. </div>
  60. </div>
  61. {% endblock content %}
  62. {% block script %}
  63. {{ super() }}
  64. <script language="javascript" type="text/javascript">
  65. function uncollapse() {
  66. $(window.location.hash).collapse({
  67. toggle: true
  68. })
  69. }
  70. </script>
  71. <script type="text/javascript" language="JavaScript">
  72. uncollapse();
  73. </script>
  74. {% endblock script %}