From 38bd0d014a36758e4b0dda64cd8fe8e05505a2c9 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 29 Apr 2025 11:58:13 +0800 Subject: fix: problematic terms template lookup order --- layouts/_default/taxonomy.html | 17 ++++++++ layouts/categories/taxonomy.html | 67 +++++++++++++++++++++++++++++ layouts/taxonomy/categories.terms.html.html | 67 ----------------------------- layouts/taxonomy/tags.terms.html.html | 17 -------- layouts/taxonomy/term.html | 42 ------------------ layouts/term/term.html | 42 ++++++++++++++++++ 6 files changed, 126 insertions(+), 126 deletions(-) create mode 100644 layouts/_default/taxonomy.html create mode 100644 layouts/categories/taxonomy.html delete mode 100644 layouts/taxonomy/categories.terms.html.html delete mode 100644 layouts/taxonomy/tags.terms.html.html delete mode 100644 layouts/taxonomy/term.html create mode 100644 layouts/term/term.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html new file mode 100644 index 00000000..025a63d7 --- /dev/null +++ b/layouts/_default/taxonomy.html @@ -0,0 +1,17 @@ +{{ define "main" }} +
+ {{ partial "header.html" . }} + {{ partial "components/postnav.html" . }} + + +
+ {{ range sort .Site.Taxonomies.tags "Count" "desc" }} + + #{{ .Page.LinkTitle }} + {{ .Count }} + + {{ end }} +
+
+{{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/categories/taxonomy.html b/layouts/categories/taxonomy.html new file mode 100644 index 00000000..5b6748d0 --- /dev/null +++ b/layouts/categories/taxonomy.html @@ -0,0 +1,67 @@ +{{ define "main" }} +
+ {{ partial "header.html" . }} + {{ partial "components/postnav.html" . }} + + + {{ partial "components/welcome.html" . }} + {{ $featured := slice "稻草人周刊" "年终总结" "揽物日志" "极客死亡计划书" }} +

周期性刊物

+
+ {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} + {{ if in $featured .Page.Title }} +
+

+ + {{ with .Page.Params.icon }}{{ . }}{{ end }} {{ .Page.LinkTitle }} + +

+

{{ .Page.Params.description | markdownify }}

+ + {{ if gt .Count 6 }} + 阅读所有 {{ .Count }} 篇文章 + {{ end }} +
+ {{ end }} + {{ end }} +
+ + +

文章系列

+
+ {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} + {{ if not (in $featured .Page.Title) }} +
+

+ + {{ with .Page.Params.icon }}{{ . }}{{ end }} {{ .Page.LinkTitle }} + +

+

{{ .Page.Params.description | markdownify }}

+ + {{ if gt .Count 6 }} + 阅读所有 {{ .Count }} 篇文章 + {{ end }} +
+ {{ end }} + {{ end }} +
+ + +
+{{ partial "footer.html" . }} +{{ end }} diff --git a/layouts/taxonomy/categories.terms.html.html b/layouts/taxonomy/categories.terms.html.html deleted file mode 100644 index 5b6748d0..00000000 --- a/layouts/taxonomy/categories.terms.html.html +++ /dev/null @@ -1,67 +0,0 @@ -{{ define "main" }} -
- {{ partial "header.html" . }} - {{ partial "components/postnav.html" . }} - - - {{ partial "components/welcome.html" . }} - {{ $featured := slice "稻草人周刊" "年终总结" "揽物日志" "极客死亡计划书" }} -

周期性刊物

-
- {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} - {{ if in $featured .Page.Title }} -
-

- - {{ with .Page.Params.icon }}{{ . }}{{ end }} {{ .Page.LinkTitle }} - -

-

{{ .Page.Params.description | markdownify }}

- - {{ if gt .Count 6 }} - 阅读所有 {{ .Count }} 篇文章 - {{ end }} -
- {{ end }} - {{ end }} -
- - -

文章系列

-
- {{ range sort .Site.Taxonomies.categories ".Count" "desc" }} - {{ if not (in $featured .Page.Title) }} -
-

- - {{ with .Page.Params.icon }}{{ . }}{{ end }} {{ .Page.LinkTitle }} - -

-

{{ .Page.Params.description | markdownify }}

- - {{ if gt .Count 6 }} - 阅读所有 {{ .Count }} 篇文章 - {{ end }} -
- {{ end }} - {{ end }} -
- - -
-{{ partial "footer.html" . }} -{{ end }} diff --git a/layouts/taxonomy/tags.terms.html.html b/layouts/taxonomy/tags.terms.html.html deleted file mode 100644 index 025a63d7..00000000 --- a/layouts/taxonomy/tags.terms.html.html +++ /dev/null @@ -1,17 +0,0 @@ -{{ define "main" }} -
- {{ partial "header.html" . }} - {{ partial "components/postnav.html" . }} - - -
- {{ range sort .Site.Taxonomies.tags "Count" "desc" }} - - #{{ .Page.LinkTitle }} - {{ .Count }} - - {{ end }} -
-
-{{ partial "footer.html" . }} -{{ end }} diff --git a/layouts/taxonomy/term.html b/layouts/taxonomy/term.html deleted file mode 100644 index 7d17833a..00000000 --- a/layouts/taxonomy/term.html +++ /dev/null @@ -1,42 +0,0 @@ -{{ define "main" }} -
- {{ partial "components/post-page-header.html" . }} - {{ partial "components/breadcrumbs.html" . }} - - {{ with .Params.description }} -
- {{ . | markdownify }} -
-
- {{ end }} - -
- -
- {{ range where .Pages "Section" "eq" "cards" }} -
-

- - {{ .Title }} - -

-

{{ .Summary }}

-
- {{ end }} -
-
-
- {{ partial "footer.html" . }} -{{ end }} diff --git a/layouts/term/term.html b/layouts/term/term.html new file mode 100644 index 00000000..7d17833a --- /dev/null +++ b/layouts/term/term.html @@ -0,0 +1,42 @@ +{{ define "main" }} +
+ {{ partial "components/post-page-header.html" . }} + {{ partial "components/breadcrumbs.html" . }} + + {{ with .Params.description }} +
+ {{ . | markdownify }} +
+
+ {{ end }} + +
+ +
+ {{ range where .Pages "Section" "eq" "cards" }} +
+

+ + {{ .Title }} + +

+

{{ .Summary }}

+
+ {{ end }} +
+
+
+ {{ partial "footer.html" . }} +{{ end }} -- cgit v1.2.3