tags.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. layout: page
  3. title: 'Tag Index'
  4. ---
  5. {% assign date_format = site.date_format | default: "%B %-d, %Y" %}
  6. {%- capture site_tags -%}
  7. {%- for tag in site.tags -%}
  8. {{- tag | first -}}{%- unless forloop.last -%},{%- endunless -%}
  9. {%- endfor -%}
  10. {%- endcapture -%}
  11. {%- assign tags_list = site_tags | split:',' | sort -%}
  12. {%- for tag in tags_list -%}
  13. <a href="#{{- tag -}}" class="btn btn-primary tag-btn"><i class="fas fa-tag" aria-hidden="true"></i>&nbsp;{{- tag -}}&nbsp;({{site.tags[tag].size}})</a>
  14. {%- endfor -%}
  15. <div id="full-tags-list">
  16. {%- for tag in tags_list -%}
  17. <h2 id="{{- tag -}}" class="linked-section">
  18. <i class="fas fa-tag" aria-hidden="true"></i>
  19. &nbsp;{{- tag -}}&nbsp;({{site.tags[tag].size}})
  20. </h2>
  21. <div class="post-list">
  22. {%- for post in site.tags[tag] -%}
  23. <div class="tag-entry">
  24. <a href="{{ post.url | relative_url }}">{{- post.title -}}</a>
  25. <div class="entry-date">
  26. <time datetime="{{- post.date | date_to_xmlschema -}}">{{- post.date | date: date_format -}}</time>
  27. </div>
  28. </div>
  29. {%- endfor -%}
  30. </div>
  31. {%- endfor -%}
  32. </div>