From c3b3299cad9f7e398ece013df37bbaa558f207b8 Mon Sep 17 00:00:00 2001 From: Erzbir Date: Sat, 15 Nov 2025 02:08:02 +0800 Subject: [PATCH] feat: page title custom --- settings.yaml | 28 ++++++++++++++++++++++++++++ templates/archives.html | 6 +++++- templates/categories.html | 6 +++++- templates/category.html | 3 ++- templates/links.html | 6 +++++- templates/tag.html | 3 ++- templates/tags.html | 6 +++++- 7 files changed, 52 insertions(+), 6 deletions(-) diff --git a/settings.yaml b/settings.yaml index b2b8e1e..f235a54 100644 --- a/settings.yaml +++ b/settings.yaml @@ -25,6 +25,34 @@ spec: label: 启用 PJAX help: 是否启用 PJAX, 默认关闭 value: false + - group: page + label: 页面配置 + formSchema: + - $formkit: text + name: archives_title + label: 归档页标题自定义 + value: + - $formkit: text + name: categories_title + label: 分类页(复数) 标题自定义 + value: + - $formkit: text + name: category_title + label: 分类页标题自定义 + value: + - $formkit: + name: tags_title + label: 标签页(复数) 标题自定义 + value: + - $formkit: + name: tag_title + label: 标签页标题自定义 + value: + - $formkit: text + name: links_title + label: 友链页标题自定义 + value: + - group: style label: 样式设置 formSchema: diff --git a/templates/archives.html b/templates/archives.html index f5e856c..6b68d27 100644 --- a/templates/archives.html +++ b/templates/archives.html @@ -6,7 +6,11 @@
-

Archives

+

+ Archives +

diff --git a/templates/categories.html b/templates/categories.html index c060106..7e55f84 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -6,7 +6,11 @@
-

Categories

+

+ Categories +

    diff --git a/templates/category.html b/templates/category.html index 264a658..163409c 100644 --- a/templates/category.html +++ b/templates/category.html @@ -7,7 +7,8 @@

    + th:with="title=${theme.config.page.category_title ?: page.category.title ?: 'Category'}" + th:text="|${title}: ${category.spec.displayName} [${category.status.visiblePostCount ?: 0}]|"> Category: Category name [n]

    diff --git a/templates/links.html b/templates/links.html index 297b494..cf2312f 100644 --- a/templates/links.html +++ b/templates/links.html @@ -4,7 +4,11 @@
    -

    Links

    +

    + Links +

    diff --git a/templates/tag.html b/templates/tag.html index 1207e95..771cecb 100644 --- a/templates/tag.html +++ b/templates/tag.html @@ -7,7 +7,8 @@

    + th:with="title=${theme.config.page.tag_title ?: page.tag.title ?: 'Tag'}" + th:text="|${title}: ${tag.spec.displayName} [${tag.status.visiblePostCount ?: 0}]|"> Tag: Tag name [n]

    diff --git a/templates/tags.html b/templates/tags.html index 6bb8692..9be9f30 100644 --- a/templates/tags.html +++ b/templates/tags.html @@ -6,7 +6,11 @@
    -

    Tags

    +

    + Tags +