tags.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {% extends 'base.html' %}
  2. {% block title %}
  3. All Tags · {{ super() }}
  4. {% endblock title %}
  5. {% block head_description %}
  6. All tags used in the {{ SITENAME|striptags|e }} blog.
  7. {% endblock head_description %}
  8. {% block meta_tags_in_head %}
  9. {{ super() }}
  10. <meta property="og:title" content="All Tags · {{ SITENAME|striptags|e }}"/>
  11. <meta name="twitter:title" content="All Tags · {{ SITENAME|striptags|e }}">
  12. <meta property="og:url" content="{{ SITEURL }}/tags.html" />
  13. <meta property="og:description" content="All tags used in the {{ SITENAME|striptags|e }} blog" />
  14. <meta name="twitter:description" content="All tags used in 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_tags.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 }}/tags.html">All Tags</a></h1>
  31. </header>
  32. </div>
  33. <div class="row">
  34. <div class="col-md-8 col-md-offset-2">
  35. <form class="form-search">
  36. <input type="text" class="input-medium search-query filterinput" placeholder="Find a tag">
  37. </form>
  38. <ul class="list-of-tags">
  39. {% for tag, articles in tags|sort %}
  40. <li>
  41. {% set num = articles|count %}
  42. <a href="#{{ tag.slug }}-ref">{{ tag }}<span>{{ num }}</span></a>
  43. </li>
  44. {% endfor %}
  45. </ul>
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="col-md-8 col-md-offset-2">
  50. {% for tag, articles in tags|sort %}
  51. <h2 id="{{ tag.slug }}-ref" class="tag-title">{{ tag }}</h2>
  52. <ul class="articles-in-tag list-articles-category">
  53. {% for article in articles|sort(reverse = true, attribute = 'date') %}
  54. <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>
  55. {% endfor %}
  56. </ul>
  57. {% endfor %}
  58. </div>
  59. </div>
  60. {% endblock content %}
  61. {% block script %}
  62. {{ super() }}
  63. <script>
  64. (function ($) {
  65. // custom css expression for a case-insensitive contains()
  66. jQuery.expr[':'].Contains = function(a,i,m){
  67. return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
  68. };
  69. function listFilter() {
  70. $('.filterinput')
  71. .change( function () {
  72. var filter = $(this).val();
  73. if(filter) {
  74. // this finds all links in a list that contain the input,
  75. // and hide the ones not containing the input while showing the ones that do
  76. $('.list-of-tags').find("a:not(:Contains(" + filter + "))").parent().hide();
  77. $('.list-of-tags').find("a:Contains(" + filter + ")").parent().show();
  78. } else {
  79. $('.list-of-tags').find("li").show();
  80. }
  81. return false;
  82. })
  83. .keyup( function () {
  84. // fire the above change event after every letter
  85. $(this).change();
  86. });
  87. }
  88. //ondomready
  89. $(function () {
  90. listFilter($());
  91. });
  92. }(jQuery));
  93. </script>
  94. {% endblock script %}