From: Danilo M. Date: Wed, 15 Apr 2026 20:05:38 +0000 (+0200) Subject: Implement taxonomy system for tags and categories X-Git-Tag: release_22042026-1342~239 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=d32ef68eabe6fb8d044d936d2e59909cd613920d;p=danix.xyz-2.git Implement taxonomy system for tags and categories - Enable tags and categories taxonomies in hugo.toml - Create taxonomy/list.html for archive pages (/tags, /categories) - Create taxonomy/term.html for individual term pages (/tags/example) - Add quote shortcode for quote-type articles - Both templates reuse article-list-item partial for consistent styling Co-Authored-By: Claude Haiku 4.5 --- diff --git a/hugo.toml b/hugo.toml index a3970ce..f5019c0 100644 --- a/hugo.toml +++ b/hugo.toml @@ -77,6 +77,11 @@ enableRobotsTXT = true name = "legal" weight = 4 +# Taxonomies +[taxonomies] + tag = "tags" + category = "categories" + # Theme parameters [params] siteName = "danix.xyz" diff --git a/themes/danix-xyz-hacker/layouts/shortcodes/quote.html b/themes/danix-xyz-hacker/layouts/shortcodes/quote.html new file mode 100644 index 0000000..1ed5c3c --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/shortcodes/quote.html @@ -0,0 +1,15 @@ +{{- $source := .Get "source" -}} +{{- $src := .Get "src" -}} + +
+

{{ .Inner }}

+ {{- if $source -}} +
+ {{- if $src -}} + — {{ $source }} + {{- else -}} + — {{ $source }} + {{- end -}} +
+ {{- end -}} +
diff --git a/themes/danix-xyz-hacker/layouts/taxonomy/list.html b/themes/danix-xyz-hacker/layouts/taxonomy/list.html new file mode 100644 index 0000000..fd4b5d9 --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/taxonomy/list.html @@ -0,0 +1,31 @@ +{{ define "main" }} +
+ +

+ {{ i18n .Data.Plural }} +

+ + +
+ {{ $pinned := where .Pages "Params.pinned" true }} + {{ $unpinned := where .Pages "Params.pinned" false }} + + + {{ range (sort $pinned "Date" "desc") }} + {{ partial "article-list-item.html" . }} + {{ end }} + + + {{ range (sort $unpinned "Date" "desc") }} + {{ partial "article-list-item.html" . }} + {{ end }} + + + {{ if eq (len .Pages) 0 }} +
+ {{ i18n "noRelated" }} +
+ {{ end }} +
+
+{{ end }} diff --git a/themes/danix-xyz-hacker/layouts/taxonomy/term.html b/themes/danix-xyz-hacker/layouts/taxonomy/term.html new file mode 100644 index 0000000..5353715 --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/taxonomy/term.html @@ -0,0 +1,38 @@ +{{ define "main" }} +
+ +

+ {{ i18n .Data.Singular }} +

+ + +

+ + {{ .Title }} + +

+ + +
+ {{ $pinned := where .Pages "Params.pinned" true }} + {{ $unpinned := where .Pages "Params.pinned" false }} + + + {{ range (sort $pinned "Date" "desc") }} + {{ partial "article-list-item.html" . }} + {{ end }} + + + {{ range (sort $unpinned "Date" "desc") }} + {{ partial "article-list-item.html" . }} + {{ end }} + + + {{ if eq (len .Pages) 0 }} +
+ {{ i18n "noRelated" }} +
+ {{ end }} +
+
+{{ end }}