From 4a069927158908e4664848bc122933dda6dad472 Mon Sep 17 00:00:00 2001 From: rohow Date: Tue, 16 Jun 2026 18:12:06 +0800 Subject: [PATCH] refactor(theme): enhance link resolution logic for archives, categories, and tags --- settings.yaml | 4 ++-- templates/category.html | 3 ++- templates/modules/activity-bar.html | 18 +++++++++++------- templates/post.html | 4 +--- templates/tag.html | 3 ++- 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/settings.yaml b/settings.yaml index 540ace2..31b8924 100644 --- a/settings.yaml +++ b/settings.yaml @@ -78,14 +78,14 @@ spec: position: up label: 分类 icon: script-text - url: /categories + url: "" external: false - enabled: true type: tags position: up label: 标签 icon: label - url: /tags + url: "" external: false - enabled: true type: login diff --git a/templates/category.html b/templates/category.html index 232b25c..96b20b3 100644 --- a/templates/category.html +++ b/templates/category.html @@ -10,7 +10,8 @@ category.md ×
@@ -29,7 +31,7 @@ itemType=${!#strings.isEmpty(item.type) ? item.type : (!#strings.isEmpty(item.key) ? item.key : 'custom')}, entryAction=${itemType == 'search' or item.action == 'search' ? 'search' : 'link'}, entryConfiguredHref=${!#strings.isEmpty(item.url) ? item.url : (!#strings.isEmpty(item.href) ? item.href : '#')}, - entryHref=${entryAction == 'search' ? '#' : (itemType == 'archive' ? activityArchiveHref : entryConfiguredHref)}, + entryHref=${entryAction == 'search' ? '#' : (itemType == 'archive' ? activityArchiveHref : (itemType == 'categories' ? activityCategoriesHref : (itemType == 'tags' ? activityTagsHref : entryConfiguredHref)))}, entryLabel=${!#strings.isEmpty(item.label) ? item.label : (!#strings.isEmpty(item.labelKey) ? #messages.msg(item.labelKey) : #messages.msg('devcm.activity.link'))}" > @@ -121,7 +124,8 @@ @@ -138,7 +142,7 @@ itemType=${!#strings.isEmpty(item.type) ? item.type : (!#strings.isEmpty(item.key) ? item.key : 'custom')}, entryAction=${itemType == 'search' or item.action == 'search' ? 'search' : 'link'}, entryConfiguredHref=${!#strings.isEmpty(item.url) ? item.url : (!#strings.isEmpty(item.href) ? item.href : '#')}, - entryHref=${entryAction == 'search' ? '#' : (itemType == 'archive' ? activityArchiveHref : entryConfiguredHref)}, + entryHref=${entryAction == 'search' ? '#' : (itemType == 'archive' ? activityArchiveHref : (itemType == 'categories' ? activityCategoriesHref : (itemType == 'tags' ? activityTagsHref : entryConfiguredHref)))}, entryLabel=${!#strings.isEmpty(item.label) ? item.label : (!#strings.isEmpty(item.labelKey) ? #messages.msg(item.labelKey) : #messages.msg('devcm.activity.link'))}" > post tag.md ×