diff options
| author | eltrac <hi@eltr.ac> | 2026-02-15 10:21:42 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-02-15 10:21:42 +0800 |
| commit | 9a9de3cb078d77409af895c74e145ec999e2bd90 (patch) | |
| tree | 4e4aac938bb989b38507cd869b48d10b6275707a /layouts/_partials | |
| parent | 5ecd478ad28db83d409b45f8d15c36567b372c89 (diff) | |
refactor: reduce all-tags partial
Diffstat (limited to 'layouts/_partials')
| -rw-r--r-- | layouts/_partials/taxonomy/all-tags.html | 46 |
1 files changed, 0 insertions, 46 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> |
