From 54533f62e9c375f955bb0010205de9f18a41075f Mon Sep 17 00:00:00 2001 From: Drew Date: Tue, 22 Apr 2025 16:36:54 -0600 Subject: [PATCH] makes partial out of tag cloud --- layouts/_default/taxonomy.html | 14 ++------------ layouts/index.html | 10 ++-------- layouts/partials/taxonomy-cloud.html | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 layouts/partials/taxonomy-cloud.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index f2f079a..86b774b 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -13,18 +13,8 @@
-
- {{ $terms := index .Site.Taxonomies .Data.Plural }} - {{ range $term, $pages := $terms }} - {{ if ne $term $.Title }} - {{ with $.Site.GetPage (printf "/%s/%s" $.Data.Plural ($term | urlize)) }} - - {{ .Title }} - - {{ end }} - {{ end }} - {{ end }} +
+ {{ partial "taxonomy-cloud" (dict "taxonomy" .Data.Singular "Site" .Site "page" .Page) }}
diff --git a/layouts/index.html b/layouts/index.html index ce4e909..eb3e9a5 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -19,14 +19,8 @@
-
- {{ $topics := .Site.Taxonomies.topics }} - {{ range $tag, $pages := $topics }} - - {{ $tag }} - - {{ end }} +
+ {{ partial "taxonomy-cloud" (dict "taxonomy" "topics" "Site" .Site) }}
diff --git a/layouts/partials/taxonomy-cloud.html b/layouts/partials/taxonomy-cloud.html new file mode 100644 index 0000000..128ae6c --- /dev/null +++ b/layouts/partials/taxonomy-cloud.html @@ -0,0 +1,16 @@ +{{ $taxonomy := .taxonomy }} +{{ range $term, $pages := index .Site.Taxonomies $taxonomy }} +{{ $termPage := $.Site.GetPage (printf "/%s/%s" $taxonomy $term) }} + + {{ $term }} + +{{ end }}