From 23cde7acee45fa6cd9a95a68cd2ba92c5a5218cf Mon Sep 17 00:00:00 2001 From: Eltrac Date: Mon, 7 Apr 2025 15:16:26 +0800 Subject: feat: separate tags and categories page also add footer to both taxonomy pages --- assets/css/components/_pages.scss | 3 +-- i18n/en.yml | 1 + i18n/zh.yml | 1 + layouts/_default/taxonomy.html | 22 ++++++++++++++++------ layouts/partials/components/postnav.html | 3 +++ 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/assets/css/components/_pages.scss b/assets/css/components/_pages.scss index 3bc0de1c..9b5e10cd 100644 --- a/assets/css/components/_pages.scss +++ b/assets/css/components/_pages.scss @@ -2,11 +2,10 @@ #post-series-list { display: flex; - justify-content: center; gap: 0.5rem; @media screen and (min-width: 768px) { - margin: 1rem; + margin: 2rem 0; gap: 1rem; } diff --git a/i18n/en.yml b/i18n/en.yml index a62b972a..cb40236c 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -13,3 +13,4 @@ searchInstruction: '⌘+K to search anywhere' postNav: latest: 'Latest' categories: 'Categories' + tags: 'Tags' diff --git a/i18n/zh.yml b/i18n/zh.yml index 6273feb8..f8e4a3ca 100644 --- a/i18n/zh.yml +++ b/i18n/zh.yml @@ -13,3 +13,4 @@ searchInstruction: '⌘+K 在任何地方搜索' postNav: latest: '最新' categories: '分类' + tags: '标签' diff --git a/layouts/_default/taxonomy.html b/layouts/_default/taxonomy.html index f0dd979a..5e0dbdeb 100644 --- a/layouts/_default/taxonomy.html +++ b/layouts/_default/taxonomy.html @@ -2,17 +2,22 @@
{{ partial "header.html" . }} {{ partial "components/postnav.html" . }} + + {{ if eq .Type "tags" }}
- {{ range sort .Site.Taxonomies.tags "Count" "desc" }} - - #{{ .Page.LinkTitle }} - {{ .Count }} - - {{ end }} + {{ range sort .Site.Taxonomies.tags "Count" "desc" }} + + #{{ .Page.LinkTitle }} + {{ .Count }} + + {{ end }}
+ {{ end }} + {{ if eq .Type "categories" }} + {{ partial "components/welcome.html" . }}
{{ range .Site.Taxonomies.categories.Alphabetical }}
@@ -22,9 +27,14 @@
  • {{ .Title }}
  • {{ end }} + {{ if gt .Count 3 }} 阅读所有 {{ .Count }} 篇文章 + {{ end }}
    {{ end }}
    + {{ end }} +
    +{{ partial "footer.html" . }} {{ end }} diff --git a/layouts/partials/components/postnav.html b/layouts/partials/components/postnav.html index 0d36d5b1..95f38a72 100644 --- a/layouts/partials/components/postnav.html +++ b/layouts/partials/components/postnav.html @@ -7,6 +7,9 @@
  • {{ T "postNav.categories" }}
  • +
  • + {{ T "postNav.tags" }} +
  • {{ end }}
  • {{ T "searchInstruction" }} -- cgit v1.2.3