From 48e180c515da5d0372526cefe68ede78ba379a4e Mon Sep 17 00:00:00 2001 From: Eltrac Date: Tue, 29 Apr 2025 11:47:17 +0800 Subject: refactor: adopt latest template lookup rules --- layouts/_default/taxonomy.html | 81 ----------------------------- layouts/_default/term.html | 42 --------------- layouts/taxonomy/categories.terms.html.html | 67 ++++++++++++++++++++++++ layouts/taxonomy/tags.terms.html.html | 17 ++++++ layouts/taxonomy/term.html | 42 +++++++++++++++ 5 files changed, 126 insertions(+), 123 deletions(-) delete mode 100644 layouts/_default/taxonomy.html delete mode 100644 layouts/_default/term.html create mode 100644 layouts/taxonomy/categories.terms.html.html create mode 100644 layouts/taxonomy/tags.terms.html.html create mode 100644 layouts/taxonomy/term.html diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html deleted file mode 100644 index e4ad0753..00000000 --- a/layouts/_default/taxonomy.html +++ /dev/null @@ -1,81 +0,0 @@ -{{ define "main" }} -
- {{ partial "header.html" . }} - {{ partial "components/postnav.html" . }} - - - {{ if eq .Type "tags" }} -
- {{ range sort .Site.Taxonomies.tags "Count" "desc" }} - - #{{ .Page.LinkTitle }} - {{ .Count }} - - {{ end }} -
- {{ end }} - - - {{ if eq .Type "categories" }} - {{ 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 }} -
- - - {{ end }} -
-{{ partial "footer.html" . }} -{{ end }} diff --git a/layouts/_default/term.html b/layouts/_default/term.html deleted file mode 100644 index 4d6fe390..00000000 --- a/layouts/_default/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/taxonomy/categories.terms.html.html b/layouts/taxonomy/categories.terms.html.html new file mode 100644 index 00000000..5b6748d0 --- /dev/null +++ b/layouts/taxonomy/categories.terms.html.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/tags.terms.html.html b/layouts/taxonomy/tags.terms.html.html new file mode 100644 index 00000000..025a63d7 --- /dev/null +++ b/layouts/taxonomy/tags.terms.html.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/taxonomy/term.html b/layouts/taxonomy/term.html new file mode 100644 index 00000000..4d6fe390 --- /dev/null +++ b/layouts/taxonomy/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