From 7c20b8329a68d788b1a60327330a34b6e2a1ab33 Mon Sep 17 00:00:00 2001 From: Patrick Kollitsch Date: Thu, 2 May 2024 19:58:04 +0700 Subject: [PATCH] fix: move tag generation and lists around see #893 Signed-off-by: Patrick Kollitsch --- layouts/_default/taxonomy.html | 3 +- layouts/_default/term.html | 3 +- .../partials/content/components/tags/tag.html | 6 -- .../components/tags/tags-overview.html | 80 +++++++++++++++---- .../content/components/tags/tags.html | 16 +--- .../content/sections/tagoverview.html | 11 --- 6 files changed, 72 insertions(+), 47 deletions(-) delete mode 100644 layouts/partials/content/components/tags/tag.html delete mode 100644 layouts/partials/content/sections/tagoverview.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index 388d547c3..5551a1244 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -22,5 +22,6 @@

{{ lang.Translate "theme.tags" }}

- {{- partials.Include "content/sections/tagoverview.html" . -}} + {{- $options := dict "type" "list" "context" . -}} + {{- partial "content/components/tags/tags-overview.html" $options -}} {{- end -}} diff --git a/layouts/_default/term.html b/layouts/_default/term.html index e7681e18c..5ffb38703 100644 --- a/layouts/_default/term.html +++ b/layouts/_default/term.html @@ -16,6 +16,7 @@

{{- partials.Include "content/sections/posts.html" . -}} - {{- partials.Include "content/sections/tagoverview.html" . -}} + {{- $options := dict "type" "list" "context" . -}} + {{- partial "content/components/tags/tags-overview.html" $options -}} {{- partials.Include "func/hook.html" ( collections.Dictionary "hook" "container-end" "context" . ) -}} {{- end -}} diff --git a/layouts/partials/content/components/tags/tag.html b/layouts/partials/content/components/tags/tag.html deleted file mode 100644 index 9184cfe19..000000000 --- a/layouts/partials/content/components/tags/tag.html +++ /dev/null @@ -1,6 +0,0 @@ - - - {{- partials.Include "icon.html" "tag-fill" -}} - {{- page.Title -}} ({{- .Count -}}) - - diff --git a/layouts/partials/content/components/tags/tags-overview.html b/layouts/partials/content/components/tags/tags-overview.html index 95297aa83..46c80afb4 100644 --- a/layouts/partials/content/components/tags/tags-overview.html +++ b/layouts/partials/content/components/tags/tags-overview.html @@ -1,15 +1,67 @@ -{{- $current := .Name -}} - +{{- else -}} + {{- partialCached "tags/taglist.html" .context -}} +{{- end -}} + +{{- define "partials/tags/taglist.html" -}} + + {{- $current := page.Name -}} +
+
+
+ +
+
+
+ {{- end -}} + +{{- define "partials/tags/single-tag.html" -}} + + + + {{- partials.Include "icon.html" "tag-fill" -}} + {{- .Title -}} + {{/* ({{- .Count -}}) */}} + + + + + {{ with .Params.icon -}} + {{ partials.Include "icon.html" . }} + {{ end }} + + + +{{- end -}} diff --git a/layouts/partials/content/components/tags/tags.html b/layouts/partials/content/components/tags/tags.html index 2dc83c8ff..1f1912c14 100644 --- a/layouts/partials/content/components/tags/tags.html +++ b/layouts/partials/content/components/tags/tags.html @@ -1,18 +1,6 @@ {{- with (.GetTerms "tags") -}}
- {{- range . -}} - - {{ with .Params.icon -}} - {{ partials.Include "icon.html" . }} - {{ end }} - - - {{- end -}} + {{- $options := dict "tags" . "type" "page" "icon" "tag-fill" -}} + {{- partial "content/components/tags/tags-overview.html" $options -}}
{{- end -}} diff --git a/layouts/partials/content/sections/tagoverview.html b/layouts/partials/content/sections/tagoverview.html deleted file mode 100644 index 39d841e14..000000000 --- a/layouts/partials/content/sections/tagoverview.html +++ /dev/null @@ -1,11 +0,0 @@ -
-
-
-
-
- {{- partials.IncludeCached "content/components/tags/tags-overview.html" . -}} -
-
-
-
-