add tags and categories

This commit is contained in:
geekifan
2025-04-23 09:21:54 +08:00
parent 4648863457
commit 370180de16
11 changed files with 270 additions and 26 deletions

View File

@ -0,0 +1,28 @@
{{ define "main" }}
<article class="px-1">
<h1 class="dynamic-title">
{{ i18n "tabs.tags" }}
</h1>
<div class="content">
<div id="tags" class="d-flex flex-wrap mx-xl-2">
{{ $tags := slice }}
{{ range $name, $taxonomy := .Site.Taxonomies.tags }}
{{ $tags = $tags | append $name }}
{{ end }}
{{ $sorted_tags := sort $tags }}
{{ range $sorted_tags }}
<div>
<a class="tag" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/">
{{ . -}}
<span class="text-muted">{{ len (index $.Site.Taxonomies.tags .) }}</span>
</a>
</div>
{{ end }}
</div>
</div>
</article>
{{ end }}