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

index f0a7d081afa72cb4e0a04e3c7b71085ce0311b89..1e072de98845e94c69b99d901dad190f266f2064 100644 (file)
@@ -3,6 +3,8 @@
 <title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
 {{ partialCached "head/css.html" . }}
 {{ partialCached "head/js.html" . }}
+{{ with $ctx.style }}
 <style>
-{{ partialCached "head/terms.css" . | safeCSS }}
+  {{ partial . $style | safeCSS }}
 </style>
+{{ end }}
diff --git a/hugo/themes/thymeleaf/layouts/categories/terms.html b/hugo/themes/thymeleaf/layouts/categories/terms.html
deleted file mode 100644 (file)
index 6fd2654..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{{- 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
deleted file mode 100644 (file)
index 6fd2654..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-{{- 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/terms.html b/hugo/themes/thymeleaf/layouts/terms.html
new file mode 100644 (file)
index 0000000..9586c51
--- /dev/null
@@ -0,0 +1,31 @@
+{{- define "main" }}
+
+{{ if not .Params.style }}
+  {{ $ctx = merge . (dict "style" "head/terms.css") }}
+{{ end }}
+
+{{- 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 */ -}}