Files
gitea-pages/tagindex.html

39 lines
1.2 KiB
HTML

---
title: Tag Index
excerpt: "An archive of posts sorted by tag."
permalink: /tagindex/
search: exclude
related_pages: none
---
{% capture site_tags %}{% for tag in site.tags %}{{ tag | first }}{% unless forloop.last %},{% endunless %}{% endfor %}{% endcapture %}
{% assign tags_list = site_tags | split:',' | sort %}
{% for item in (0..site.tags.size) %}{% unless forloop.last %}
{% capture this_word %}{{ tags_list[item] | strip_newlines }}{% endcapture %}
<h2 id="{{ this_word }}">{{ this_word }}</h2>
<ul class="post-list">
{% for post in site.tags[this_word] %}{% if post.title != null %}
<li><a href="{{post.url | prepend: site.baseurl}}">{{ post.title }}<span class="entry-date"><time datetime="{{ post.date | date_to_xmlschema }}"> ({{ post.date | date: "%B %d, %Y" }}</time>)</span></a></li>
{% endif %}{% endfor %}
</ul>
{% endunless %}{% endfor %}
<hr />
{% capture tags %}
{% for tag in site.tags %}
{{ tag[0] }}
{% endfor %}
{% endcapture %}
{% assign sortedtags = tags | split:' ' | sort %}
{% for tag in sortedtags %}
<h3 id="{{ tag }}">{{ tag }}</h3>
<ul>
{% for post in site.tags[tag] %}
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
{% endfor %}
</ul>
{% endfor %}