From 1330523844f96bd4d955f74744ffbb7d2843b3c6 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Mon, 10 Jul 2023 22:20:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 27 +++++++++++++++++++ templates/categories.html | 7 ++--- templates/fcircle.html | 11 ++++---- templates/links.html | 9 ++++--- templates/modules/head.html | 21 ++++++++------- templates/modules/layouts/layout.html | 27 ++++++++++--------- templates/modules/right-menu.html | 5 ++-- templates/modules/twikoo.html | 2 +- templates/modules/widgets/aside/comments.html | 2 +- .../modules/widgets/cardNewestComments.html | 2 +- templates/music.html | 5 ++-- theme.yaml | 2 +- 12 files changed, 77 insertions(+), 43 deletions(-) diff --git a/settings.yaml b/settings.yaml index afdb8a18..de359022 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1641,6 +1641,33 @@ spec: - group: other label: 其他设置 formSchema: + - $formkit: group + name: staticResource + label: 静态资源文件设置 + value: + use: + cdn_link: + children: + - $formkit: select + name: use + id: use + key: use + label: 类型选择 + value: local + options: + - label: 本地 + value: local + - label: elemecdn + value: elemecdn + - label: 自定义 + value: custom + - $formkit: url + name: cdn_link + if: "$get(use).value == 'custom'" + label: cdn地址,外链地址 + validation: required + value: '(https://npm.elemecdn.com/hao-theme-static@1.1.5/templates/assets' + help: '默认为npmJs的elemecdn加速地址,如果你有自己的cdn地址(请确保链接下assets文件夹下主题静态资源文件),可以填写,否则请勿修改! ' - $formkit: group name: diytitle label: 动态标题 diff --git a/templates/categories.html b/templates/categories.html index 6b3d12ba..03a5c28f 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -1,6 +1,7 @@ + xmlns:th="http://www.thymeleaf.org" + th:with="assets_link=${theme.config.other.staticResource.use == 'elemecdn' ? 'https://npm.elemecdn.com/hao-theme-static@' + theme.spec.version +'/templates/assets' : theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}"> @@ -24,7 +25,7 @@ - + diff --git a/templates/fcircle.html b/templates/fcircle.html index 7bcafe75..7c118f6b 100644 --- a/templates/fcircle.html +++ b/templates/fcircle.html @@ -1,6 +1,7 @@ + xmlns:th="http://www.thymeleaf.org" + th:with="assets_link=${theme.config.other.staticResource.use == 'elemecdn' ? 'https://npm.elemecdn.com/hao-theme-static@' + theme.spec.version +'/templates/assets' : theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}"> @@ -46,7 +47,7 @@ hungryFish: 500, } - + @@ -69,9 +70,9 @@ sort_rule: 'created' } - - - + + + diff --git a/templates/links.html b/templates/links.html index a092b521..d24f93f1 100644 --- a/templates/links.html +++ b/templates/links.html @@ -1,12 +1,13 @@ + xmlns:th="http://www.thymeleaf.org" + th:with="assets_link=${theme.config.other.staticResource.use == 'elemecdn' ? 'https://npm.elemecdn.com/hao-theme-static@' + theme.spec.version +'/templates/assets' : theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}">
@@ -57,7 +58,7 @@

🎣 钓鱼

+ href="javascript:fetchRandomPost();">
@@ -69,7 +70,7 @@ hungryFish: 500, } - +
diff --git a/templates/modules/head.html b/templates/modules/head.html index 5f834d16..e573ce3b 100644 --- a/templates/modules/head.html +++ b/templates/modules/head.html @@ -1,7 +1,7 @@ - + @@ -12,21 +12,21 @@ - + - + - + - + - + + th:href="${assets_link + '/libs/iconfont/iconfont.css'}"> @@ -142,7 +142,7 @@ - + @@ -153,11 +153,11 @@ - + - + - - + + + @@ -63,20 +64,20 @@ - + - + - + - + @@ -84,13 +85,13 @@ - + - + - + @@ -99,8 +100,8 @@ - - + + +
diff --git a/templates/modules/twikoo.html b/templates/modules/twikoo.html index ca8962a0..f727179e 100644 --- a/templates/modules/twikoo.html +++ b/templates/modules/twikoo.html @@ -56,7 +56,7 @@ setTimeout(runFn, 0) return } - getScript(GLOBAL_CONFIG.twikoo.js).then(runFn) + getScript(GLOBAL_CONFIG.source.twikoo.js).then(runFn) } if ('Twikoo' === 'Twikoo' || !false) { diff --git a/templates/modules/widgets/aside/comments.html b/templates/modules/widgets/aside/comments.html index ad7f4f1b..849996e6 100644 --- a/templates/modules/widgets/aside/comments.html +++ b/templates/modules/widgets/aside/comments.html @@ -45,7 +45,7 @@ if (typeof twikoo === 'object') { runTwikoo() } else { - getScript('/themes/theme-hao/assets/libs/twikoo/twikoo.all.min.js').then(runTwikoo) + getScript(GLOBAL_CONFIG.source.twikoo.js).then(runTwikoo) } })(); diff --git a/templates/modules/widgets/cardNewestComments.html b/templates/modules/widgets/cardNewestComments.html index afc81894..14c0f174 100644 --- a/templates/modules/widgets/cardNewestComments.html +++ b/templates/modules/widgets/cardNewestComments.html @@ -50,7 +50,7 @@ if (typeof twikoo === 'object') { runTwikoo() } else { - getScript(GLOBAL_CONFIG.twikoo.js).then(runTwikoo) + getScript(GLOBAL_CONFIG.source.twikoo.js).then(runTwikoo) } } diff --git a/templates/music.html b/templates/music.html index 64233076..4f1a3823 100644 --- a/templates/music.html +++ b/templates/music.html @@ -1,6 +1,7 @@ + xmlns:th="http://www.thymeleaf.org" + th:with="assets_link=${theme.config.other.staticResource.use == 'elemecdn' ? 'https://npm.elemecdn.com/hao-theme-static@' + theme.spec.version +'/templates/assets' : theme.config.other.staticResource.use == 'custom' ? theme.config.other.staticResource.cdn_link : #theme.assets('/')}"> @@ -26,7 +27,7 @@
- +
diff --git a/theme.yaml b/theme.yaml index 1133c543..bedc061c 100644 --- a/theme.yaml +++ b/theme.yaml @@ -31,5 +31,5 @@ spec: repo: https://github.com/liuzhihang/halo-theme-hao settingName: "theme-hao-setting" configMapName: "theme-hao-configMap" - version: "1.1.6" + version: "1.1.5" require: ">=2.0.0"