summaryrefslogtreecommitdiff
path: root/layouts/term.html
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2025-07-14 20:45:00 +0800
committerEltrac <hi@guhub.cn>2025-07-14 20:45:00 +0800
commit5f3933751ede3845ebc3ff319986d25515501522 (patch)
treed3057a1d5876f8daf37b590a0c9b9694e05c5bb5 /layouts/term.html
parent572b94c723a27c50bf2a9d80eebb5a245b1b50cf (diff)
refactor: combine categories and tags together and simplify templating
Diffstat (limited to 'layouts/term.html')
-rw-r--r--layouts/term.html13
1 files changed, 12 insertions, 1 deletions
diff --git a/layouts/term.html b/layouts/term.html
index 692e175e..90fb48b9 100644
--- a/layouts/term.html
+++ b/layouts/term.html
@@ -2,7 +2,18 @@
<article class="posts termlist-page">
{{ partial "header.html" . }}
{{ partial "components/postnav.html" . }}
- <h1 class="term-title">#{{ .Title }}</h1>
+ <div class="term-header">
+ <h1 class="term-title"
+ style="view-transition-name: category-{{ .Title }}">
+ {{ with .Params.icon }}
+ <span class="category-icon">{{ . }}</span>
+ {{ end }}
+ {{ if and (eq .Data.Singular "tag") (not .Params.icon) }}#{{ end }}{{ .Title }}
+ </h1>
+ {{ with .Params.description | markdownify }}
+ <p class="term-description">{{ . }}</p>
+ {{ end }}
+ </div>
<div class="term-list">
<!-- Posts under this Term -->
<ul class="term-list-posts">