From eb7a9adf1cd79ca3a258648ecaabd9c25f462800 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Sun, 29 Jun 2025 17:20:56 +0800 Subject: =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20feat:=20archive=20certain=20tag?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_index.md" | 4 + .../_index.md" | 4 + layouts/_default/taxonomy.html | 86 ++++++++++++++++++---- 3 files changed, 78 insertions(+), 16 deletions(-) create mode 100644 "content/tags/\345\206\231\344\275\234\345\277\253\351\227\252\303\237/_index.md" create mode 100644 "content/tags/\346\257\217\346\227\245\345\206\231\344\275\234\350\256\241\345\210\222\316\261/_index.md" diff --git "a/content/tags/\345\206\231\344\275\234\345\277\253\351\227\252\303\237/_index.md" "b/content/tags/\345\206\231\344\275\234\345\277\253\351\227\252\303\237/_index.md" new file mode 100644 index 00000000..609f6632 --- /dev/null +++ "b/content/tags/\345\206\231\344\275\234\345\277\253\351\227\252\303\237/_index.md" @@ -0,0 +1,4 @@ +--- +title: 写作快闪ß +category: 归档 +--- diff --git "a/content/tags/\346\257\217\346\227\245\345\206\231\344\275\234\350\256\241\345\210\222\316\261/_index.md" "b/content/tags/\346\257\217\346\227\245\345\206\231\344\275\234\350\256\241\345\210\222\316\261/_index.md" new file mode 100644 index 00000000..5e066b41 --- /dev/null +++ "b/content/tags/\346\257\217\346\227\245\345\206\231\344\275\234\350\256\241\345\210\222\316\261/_index.md" @@ -0,0 +1,4 @@ +--- +title: 每日写作计划α +category: 归档 +--- diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index e27d41a8..ef8f515f 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -5,23 +5,77 @@
- {{ range sort .Site.Taxonomies.tags "Count" "desc" }} - - {{ if .Page.Params.icon }} - {{ if or (hasPrefix .Page.Params.icon "http://") (hasPrefix .Page.Params.icon "https://") }} - - {{ .Page.LinkTitle }} - - {{ else }} - {{ .Page.Params.icon }} - {{ end }} - {{ end }} - {{ if not .Page.Params.icon }}#{{ end }}{{ .Page.LinkTitle }} - {{ .Count }} - + {{ $categorizedTags := dict }} + {{ $uncategorizedTags := slice }} + + + {{ 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 }} + + + {{ $uncategorizedTags = sort $uncategorizedTags "Count" "desc" }} + {{ range $category, $categoryTags := $categorizedTags }} + {{ $categorizedTags = merge $categorizedTags (dict $category (sort $categoryTags "Count" "desc")) }} {{ end }} + + + {{ if $uncategorizedTags }} + + {{ end }} + + + {{ range $category, $categoryTags := $categorizedTags }} + + {{ end }}
{{ partial "footer.html" . }} -- cgit v1.2.3