From fedf43ddf1ae6b87e9ecf5d3997e0000347a7c0a Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Sat, 23 Sep 2023 02:50:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dwaline=E6=9C=80=E8=BF=91?= =?UTF-8?q?=E8=AF=84=E8=AE=BAbug=EF=BC=8C=E5=9B=BE=E5=BA=93=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- settings.yaml | 16 ++- templates/assets/js/comment/waline.js | 1 + templates/modules/comment/Waline.html | 2 +- templates/modules/head.html | 130 +----------------- templates/modules/variables/site-config.html | 132 +++++++++++++++++++ templates/photos.html | 22 +++- 6 files changed, 166 insertions(+), 137 deletions(-) create mode 100644 templates/modules/variables/site-config.html diff --git a/settings.yaml b/settings.yaml index d2a939a9..95413fd5 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1612,6 +1612,12 @@ spec: key: bigTitle label: 大标题 value: 这里是我的相册集哦😯 + - $formkit: text + name: topLink + key: topLink + if: $get(photosStyle).value == 'default' + label: 返回地址 (填写图库分组地址) + value: "/album" - $formkit: text if: $get(photosStyle).value == 'default' name: detail @@ -2295,7 +2301,7 @@ spec: name: lazyload label: 评论懒加载 value: false - help: 当评论进入浏览器的视窗时,将加载评论系统。 + help: 当评论进入浏览器的视窗时,将加载评论系统。(不建议使用,定位不到评论位置) options: - label: 打开 value: true @@ -2376,6 +2382,7 @@ spec: serverURL: "" walinesJs: "" walinesCss: "" + locale: "{'placeholder': '欢迎评论', 'sofa': '来发评论吧~1'}" children: - $formkit: url name: serverURL @@ -2396,6 +2403,13 @@ spec: label: Waline评论 - css placeholder: 请输入css文件地址 help: 主题的walines版本是最新版本(如果你使用的不是最新版本请自己引入css文件) + - $formkit: code + name: locale + height: 200px + label: 选项 + placeholder: 请输入json格式数据 + help: "格式:{'placeholder': '欢迎评论', 'sofa': '来发评论吧~1'} 更多请查看文档:https://waline.js.org/cookbook/customize/locale.html#%E4%BE%8B%E5%AD%90" + language: json - $formkit: group if: ($get(use).value == 'Twikoo' || $get(use).value == 'Artalk' || $get(use).value == 'Waline' ) && $get(commentsEnable).value name: visitorMail diff --git a/templates/assets/js/comment/waline.js b/templates/assets/js/comment/waline.js index 77e93bae..c7a9717e 100644 --- a/templates/assets/js/comment/waline.js +++ b/templates/assets/js/comment/waline.js @@ -8,6 +8,7 @@ dark: 'html[data-theme="dark"]', path: window.location.pathname, comment: false, + locale:GLOBAL_CONFIG.source.waline.locale }, null)) } diff --git a/templates/modules/comment/Waline.html b/templates/modules/comment/Waline.html index 0128f000..7df69c7c 100644 --- a/templates/modules/comment/Waline.html +++ b/templates/modules/comment/Waline.html @@ -72,7 +72,7 @@ }) saveToLocal.set('waline-newest-comments', JSON.stringify(walineArray), 10 / (60 * 24)) generateHtml(walineArray) - document.querySelector('#newcomm') && necommHtml(artalk) + document.querySelector('#newcomm') && necommHtml(walineArray) }).catch(e => { const $dom = document.querySelector('#card-newest-comments .aside-list') $dom.innerHTML = "无法获取评论,请确认相关配置是否正确" diff --git a/templates/modules/head.html b/templates/modules/head.html index fb17b4af..8aa70e91 100644 --- a/templates/modules/head.html +++ b/templates/modules/head.html @@ -184,135 +184,7 @@ - - + diff --git a/templates/modules/variables/site-config.html b/templates/modules/variables/site-config.html new file mode 100644 index 00000000..2a6d3955 --- /dev/null +++ b/templates/modules/variables/site-config.html @@ -0,0 +1,132 @@ + + + + + + + \ No newline at end of file diff --git a/templates/photos.html b/templates/photos.html index 96bdb967..f8d5e98c 100644 --- a/templates/photos.html +++ b/templates/photos.html @@ -15,12 +15,22 @@ - +
+
+
+ +
+
+
+ +
+