From 9f24e82770a41933797d66feca899cb35edb2fd3 Mon Sep 17 00:00:00 2001
From: Cell <1024@lruihao.cn>
Date: Fri, 29 Dec 2023 15:57:01 +0800
Subject: [PATCH] :sparkles: Feat: add archives page template (#397)
* :sparkles: Feat: add archives page template
* :art: Style: add some icon for theme built-in templates
* :wrench: Chore: set site home relative permalink globally
* :wrench: Chore: add archives outputs config
---
docs | 2 +-
hugo.toml | 24 +++++++--
i18n/en.toml | 3 ++
i18n/zh-CN.toml | 3 ++
i18n/zh-TW.toml | 2 +
layouts/_default/section.html | 9 ++--
layouts/index.archives.html | 65 +++++++++++++++++++++++++
layouts/partials/footer.html | 2 +-
layouts/partials/header.html | 9 ++--
layouts/partials/init/global.html | 5 ++
layouts/partials/recently-updated.html | 7 ++-
layouts/partials/single/footer.html | 2 +-
layouts/posts/single.html | 5 +-
layouts/taxonomy/list.html | 12 ++---
layouts/taxonomy/terms.html | 14 +++++-
layouts/taxonomy/terms/categories.html | 4 +-
layouts/taxonomy/terms/collections.html | 4 +-
17 files changed, 143 insertions(+), 29 deletions(-)
create mode 100644 layouts/index.archives.html
diff --git a/docs b/docs
index 4120618e..af9cedea 160000
--- a/docs
+++ b/docs
@@ -1 +1 @@
-Subproject commit 4120618e08e64716fd4c07e7cd2c41b976c2d5c8
+Subproject commit af9cedead5f7fe9c0fac1173221283e236790ee9
diff --git a/hugo.toml b/hugo.toml
index 0cfacfe0..83cdd5e9 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -225,6 +225,14 @@ enableEmoji = true
mediaType = "text/plain"
isPlainText = true
isHTML = false
+ # FixIt 0.3.0 | NEW Options to make output /archives/index.html file
+ [archives]
+ path = "archives"
+ baseName = "index"
+ mediaType = "text/html"
+ isPlainText = false
+ isHTML = true
+ permalinkable = true
# -------------------------------------------------------------------------------------
# Customizing Output Formats
@@ -232,7 +240,7 @@ enableEmoji = true
# -------------------------------------------------------------------------------------
[outputs]
- home = ["HTML", "RSS", "JSON", "BaiduUrls"]
+ home = ["HTML", "RSS", "JSON", "BaiduUrls", "archives"]
page = ["HTML", "MarkDown"]
section = ["HTML", "RSS"]
taxonomy = ["HTML"]
@@ -423,15 +431,23 @@ enableEmoji = true
visitor = 0
beian = 0
- # Section (all posts) page config
+ # FixIt 0.3.0 | NEW Archives page config (all pages of posts type)
+ [params.archives]
+ # special amount of posts in archives page
+ paginate = 20
+ # date format (month and day)
+ dateFormat = "01-02"
+
+ # Section page config (all pages in section)
[params.section]
- # special amount of posts in each section page
+ # special amount of pages in each section page
paginate = 20
# date format (month and day)
dateFormat = "01-02"
# amount of RSS pages
rss = 10
- # FixIt 0.2.13 | NEW recently updated posts settings
+ # FixIt 0.2.13 | NEW recently updated pages config
+ # TODO refactor to support archives, section, taxonomy and term
[params.section.recentlyUpdated]
enable = false
rss = false
diff --git a/i18n/en.toml b/i18n/en.toml
index 42736b95..ab799cdf 100644
--- a/i18n/en.toml
+++ b/i18n/en.toml
@@ -18,6 +18,9 @@ noscript = "Theme FixIt works best with JavaScript enabled."
# === baseof ===
# === Taxonomy ===
+[archives]
+other = "Archives"
+
[allSome]
other = "All {{ .Some }}"
diff --git a/i18n/zh-CN.toml b/i18n/zh-CN.toml
index 65d70dbf..3bcc2ce0 100644
--- a/i18n/zh-CN.toml
+++ b/i18n/zh-CN.toml
@@ -19,6 +19,9 @@ noscript = "FixIt 主题在启用 JavaScript 的情况下效果最佳。"
# === baseof ===
# === Taxonomy ===
+[archives]
+other = "归档"
+
[allSome]
other = "所有{{ .Some }}"
diff --git a/i18n/zh-TW.toml b/i18n/zh-TW.toml
index ce0c0406..7300e5bb 100644
--- a/i18n/zh-TW.toml
+++ b/i18n/zh-TW.toml
@@ -19,6 +19,8 @@ noscript = "FixIt 主題在啟用 JavaScript 的情況下效果最佳。"
# === baseof ===
# === Taxonomy ===
+[archives]
+other = "歸檔"
[allSome]
other = "所有{{ .Some }}"
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
index eab029ba..7d3f7525 100644
--- a/layouts/_default/section.html
+++ b/layouts/_default/section.html
@@ -8,8 +8,8 @@