]> juplo.de Git - website/commitdiff
WIP:refactor: display terms as term/number-buttons
authorKai Moritz <kai@juplo.de>
Sat, 22 Nov 2025 15:32:34 +0000 (16:32 +0100)
committerKai Moritz <kai@juplo.de>
Sat, 22 Nov 2025 15:32:34 +0000 (16:32 +0100)
hugo/themes/thymeleaf/layouts/categories/terms.html [new file with mode: 0644]
hugo/themes/thymeleaf/layouts/tags/terms.html [new file with mode: 0644]

diff --git a/hugo/themes/thymeleaf/layouts/categories/terms.html b/hugo/themes/thymeleaf/layouts/categories/terms.html
new file mode 100644 (file)
index 0000000..6fd2654
--- /dev/null
@@ -0,0 +1,27 @@
+{{- define "main" }}
+
+{{- if .Title }}
+<header class="page-header">
+    <h1>{{ .Title }}</h1>
+    {{- if .Description }}
+    <div class="post-description">
+        {{ .Description }}
+    </div>
+    {{- end }}
+</header>
+{{- end }}
+
+<ul class="terms-tags">
+    {{- $type := .Type }}
+    {{- range $key, $value := .Data.Terms.Alphabetical }}
+    {{- $name := .Name }}
+    {{- $count := .Count }}
+    {{- with site.GetPage (printf "/%s/%s" $type $name) }}
+    <li>
+        <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
+    </li>
+    {{- end }}
+    {{- end }}
+</ul>
+
+{{- end }}{{/* end main */ -}}
diff --git a/hugo/themes/thymeleaf/layouts/tags/terms.html b/hugo/themes/thymeleaf/layouts/tags/terms.html
new file mode 100644 (file)
index 0000000..6fd2654
--- /dev/null
@@ -0,0 +1,27 @@
+{{- define "main" }}
+
+{{- if .Title }}
+<header class="page-header">
+    <h1>{{ .Title }}</h1>
+    {{- if .Description }}
+    <div class="post-description">
+        {{ .Description }}
+    </div>
+    {{- end }}
+</header>
+{{- end }}
+
+<ul class="terms-tags">
+    {{- $type := .Type }}
+    {{- range $key, $value := .Data.Terms.Alphabetical }}
+    {{- $name := .Name }}
+    {{- $count := .Count }}
+    {{- with site.GetPage (printf "/%s/%s" $type $name) }}
+    <li>
+        <a href="{{ .Permalink }}">{{ .Name }} <sup><strong><sup>{{ $count }}</sup></strong></sup> </a>
+    </li>
+    {{- end }}
+    {{- end }}
+</ul>
+
+{{- end }}{{/* end main */ -}}