summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--layouts/_partials/taxonomy/all-tags.html46
-rw-r--r--layouts/tags/taxonomy.html47
2 files changed, 46 insertions, 47 deletions
diff --git a/layouts/_partials/taxonomy/all-tags.html b/layouts/_partials/taxonomy/all-tags.html
deleted file mode 100644
index efd63fb4..00000000
--- a/layouts/_partials/taxonomy/all-tags.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!-- Display Tags -->
-<section>
- {{ $categorizedTags := dict }}
- {{ $uncategorizedTags := slice }}
-
- <!-- Group tags by category -->
- {{ range $tagName, $tagPages := .Site.Taxonomies.tags }}
- {{ $tagPage := site.GetPage (printf "/tags/%s" $tagName) }}
- {{ $tagData := dict "Name" $tagName "Count" (len $tagPages) "Page" $tagPage }}
- {{ if $tagPage.Params.category }}
- {{ $category := $tagPage.Params.category }}
- {{ $categoryTags := index $categorizedTags $category | default slice }}
- {{ $categoryTags = $categoryTags | append $tagData }}
- {{ $categorizedTags = merge $categorizedTags (dict $category $categoryTags) }}
- {{ else }}
- {{ $uncategorizedTags = $uncategorizedTags | append $tagData }}
- {{ end }}
- {{ end }}
-
- <!-- Sort tags by count -->
- {{ $uncategorizedTags = sort $uncategorizedTags "Count" "desc" }}
- {{ range $category, $categoryTags := $categorizedTags }}
- {{ $categorizedTags = merge $categorizedTags (dict $category (sort $categoryTags "Count" "desc")) }}
- {{ end }}
-
- <!-- Display uncategorized tags first -->
- {{ if $uncategorizedTags }}
- <div class="flex flex-wrap gap-2">
- {{ range $uncategorizedTags }}
- {{ partial "taxonomy/tag-pill" . }}
- {{ end }}
- </div>
- {{ end }}
-
- <!-- Display categorized tags -->
- {{ range $category, $categoryTags := $categorizedTags }}
- <div>
- <h3>{{ $category }}</h3>
- <div class="flex flex-wrap gap-2">
- {{ range $categoryTags }}
- {{ partial "taxonomy/tag-pill" . }}
- {{ end }}
- </div>
- </div>
- {{ end }}
-</section>
diff --git a/layouts/tags/taxonomy.html b/layouts/tags/taxonomy.html
index 4a6a2d6e..633e9c09 100644
--- a/layouts/tags/taxonomy.html
+++ b/layouts/tags/taxonomy.html
@@ -1,6 +1,51 @@
{{ define "main" }}
<article>
{{ partial "header" . }}
- {{ partial "taxonomy/all-tags.html" . }}
+ <!-- Display Tags -->
+ <section>
+ {{ $categorizedTags := dict }}
+ {{ $uncategorizedTags := slice }}
+
+ <!-- Group tags by category -->
+ {{ range $tagName, $tagPages := .Site.Taxonomies.tags }}
+ {{ $tagPage := site.GetPage (printf "/tags/%s" $tagName) }}
+ {{ $tagData := dict "Name" $tagName "Count" (len $tagPages) "Page" $tagPage }}
+ {{ if $tagPage.Params.category }}
+ {{ $category := $tagPage.Params.category }}
+ {{ $categoryTags := index $categorizedTags $category | default slice }}
+ {{ $categoryTags = $categoryTags | append $tagData }}
+ {{ $categorizedTags = merge $categorizedTags (dict $category $categoryTags) }}
+ {{ else }}
+ {{ $uncategorizedTags = $uncategorizedTags | append $tagData }}
+ {{ end }}
+ {{ end }}
+
+ <!-- Sort tags by count -->
+ {{ $uncategorizedTags = sort $uncategorizedTags "Count" "desc" }}
+ {{ range $category, $categoryTags := $categorizedTags }}
+ {{ $categorizedTags = merge $categorizedTags (dict $category (sort $categoryTags "Count" "desc")) }}
+ {{ end }}
+
+ <!-- Display uncategorized tags first -->
+ {{ if $uncategorizedTags }}
+ <div class="flex flex-wrap gap-2">
+ {{ range $uncategorizedTags }}
+ {{ partial "taxonomy/tag-pill" . }}
+ {{ end }}
+ </div>
+ {{ end }}
+
+ <!-- Display categorized tags -->
+ {{ range $category, $categoryTags := $categorizedTags }}
+ <div>
+ <h3>{{ $category }}</h3>
+ <div class="flex flex-wrap gap-2">
+ {{ range $categoryTags }}
+ {{ partial "taxonomy/tag-pill" . }}
+ {{ end }}
+ </div>
+ </div>
+ {{ end }}
+ </section>
{{ partial "footer.html" . }}
{{ end }}