From 10aa1881445cfa84b16319e586f69d6c10361e6e Mon Sep 17 00:00:00 2001 From: lxy <1103069291@qq.com> Date: Fri, 23 Jul 2021 20:19:27 +0800 Subject: [PATCH] =?UTF-8?q?feat(comment):=20=E8=AF=84=E8=AE=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=96=B0=E5=A2=9E=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comments.ftl | 22 ++++++++++------ settings.yaml | 69 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 81 insertions(+), 10 deletions(-) diff --git a/comments.ftl b/comments.ftl index 7489e79..5ba4691 100644 --- a/comments.ftl +++ b/comments.ftl @@ -2,13 +2,19 @@ COMMENTS TEMPLATE --> <#macro comment target,type> - + <#local + configs = '{ + "autoLoad": ${settings.comment_auto_load?string("true", "false")}, + "showUserAgent": ${settings.comment_show_user_agent?string("true", "false")}, + "gravatarSource": "${settings.comment_gravatar_source!}", + "loadingStyle": "${settings.comment_loading_style!}", + "aWord": "${settings.comment_a_word!}", + "authorPopup": "${settings.comment_author_popup!}", + "emailPopup": "${settings.comment_email_popup!}", + "urlPopup": "${settings.comment_url_popup!}", + "notComment": "${settings.comment_not_comment!}" + }' + > <#if (!target.disallowComment!false) && (!settings.keep_record_mode!false)>
@@ -16,7 +22,7 @@ - +
diff --git a/settings.yaml b/settings.yaml index e6ef39c..9ee8b03 100644 --- a/settings.yaml +++ b/settings.yaml @@ -547,8 +547,73 @@ comment: label: 评论模块js type: text default: "https://cdn.jsdelivr.net/gh/LIlGG/halo-comment-sakura/dist/halo-comment.min.js" - description: "评论js模块,如果当前为空,则获取评论设置中的模块js" - comment_custom_style: + description: "评论js模块,如果当前设置为空,则使用评论设置中的模块js" + comment_auto_load: + name: comment_custom_style + label: 是否自动加载评论列表 + type: radio + data-type: bool + default: true + options: + - value: true + label: 开启 + - value: false + label: 关闭 + comment_show_user_agent: + name: comment_show_user_agent + label: 是否显示评论者的 UA 信息 + type: radio + data-type: bool + default: true + options: + - value: true + label: 开启 + - value: false + label: 关闭 + comment_gravatar_source: + name: comment_gravatar_source + label: Gravatar 源地址 + type: text + default: "//cn.gravatar.com/avatar" + description: "暂时用于适配 Halo 1.4.8 以下用户,当主题最低要求 Halo 1.4.8 之后将移除" + comment_loading_style: + name: comment_loading_style + label: 评论加载样式 + type: select + default: default + options: + - value: default + label: 默认 + - value: circle + label: 循环圆圈 + - value: balls + label: 圆圈波浪 + comment_a_word: + name: comment_a_word + label: 评论框内的一言 + type: text + default: "你是我一生只会遇见一次的惊喜 ..." + comment_author_popup: + name: comment_author_popup + label: 填写昵称时的提示 + type: text + default: "输入QQ号将自动拉取昵称和头像" + comment_email_popup: + name: comment_email_popup + label: 填写 email 时的提示 + type: text + default: "你将收到回复通知" + comment_url_popup: + name: comment_url_popup + label: 填写网站链接时的提示 + type: text + default: "禁止小广告😀" + comment_not_comment: + name: comment_not_comment + label: 没有评论时显示的语句 + type: text + default: "暂无评论" +comment_custom_style: name: comment_custom_style label: 自定义评论组件CSS样式 type: textarea