categories.html 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {% extends "index.html" %}
  2. {% block title %}
  3. Categories – {{ SITENAME }}
  4. {% endblock title %}
  5. {% block header %}
  6. <div class="container">
  7. <div class="row">
  8. <div class="col-8">
  9. <h3 id="Categories in {{ SITENAME }}" style="color: orange;">Categories in {{ SITENAME }}</h3>
  10. </div>
  11. <div class="col-4 small" style="margin-top: 0.5rem;">
  12. {% if ADD_THIS_ID and (page_name or page or article) %}
  13. <div class="text-right mb-2 small" style="height: 26px">
  14. <div class="addthis_inline_share_toolbox"></div>
  15. </div>
  16. {% endif %}
  17. </div>
  18. </div>
  19. </div>
  20. {% endblock header %}
  21. {% block add_this %}
  22. {# remove ADD_THIS in content, move to above header #}
  23. {% endblock add_this %}
  24. {% block content %}
  25. <!--
  26. <div class="text-center">
  27. {% for category, articles in categories|sort %}
  28. <a class="btn btn-success btn-sm" href="{{ SITEURL }}/{{ category.url }}">
  29. {{ category|lower }} <span class="badge badge-warning" style="font-size: small;">{{ articles|count }}</span>
  30. </a>
  31. {% endfor %}
  32. </div>
  33. -->
  34. <!-- Accordion -->
  35. <div id="accordionList" class="accordion shadow">
  36. {% for category, articles in categories|sort %}
  37. <!-- Accordion items -->
  38. <div class="card">
  39. <div id="heading_{{ category|lower }}" class="card-header bg-white shadow-sm border-0">
  40. <h2 class="mb-0">
  41. <button type="button" data-toggle="collapse" data-target="#collapse{{ category|lower }}" aria-expanded="false" aria-controls="collapse{{ category|lower }}" class="btn btn-link text-dark font-weight-bold collapsible-link collapsed">
  42. {{ category|lower }} <span class="badge badge-warning" style="font-size: small;">{{ articles|count }}</span>
  43. </button>
  44. </h2>
  45. </div>
  46. <!-- Item list -->
  47. <div id="collapse{{ category|lower }}" aria-labelledby="heading_{{ category|lower }}" data-parent="#accordionList" class="collapse" style="background-color: whitesmoke">
  48. {% for article in articles %}
  49. <div class="card-body border-bottom">
  50. <a class="m-0" href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a><br>
  51. <span class="small">by <a href="{{ SITEURL }}/{{ article.author.url }}" style="color: darkblue;">{{ article.author }}</a>, post on <span class="text-success">{{ article.locale_date }}</span></span>
  52. </div>
  53. {% endfor %}
  54. </div>
  55. </div>
  56. {% endfor %}
  57. </div>
  58. <!-- Google Adsense -->
  59. {% if GOOGLE_ADSENSE and GOOGLE_ADSENSE.ads.page %}
  60. <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  61. <!-- ad-home -->
  62. <ins class="adsbygoogle"
  63. style="display:block"
  64. data-ad-client="{{ GOOGLE_ADSENSE.id }}"
  65. data-ad-slot="{{ GOOGLE_ADSENSE.ads.page }}"
  66. data-ad-format="auto"
  67. data-full-width-responsive="true"></ins>
  68. <script>
  69. (adsbygoogle = window.adsbygoogle || []).push({});
  70. </script>
  71. {% endif %}
  72. {% endblock content %}