From 8d3a165be7fd4a0ec8027ff058b98f42ec896577 Mon Sep 17 00:00:00 2001 From: "1152958806@qq.com" <1152958806@qq.com> Date: Sat, 23 Sep 2023 00:01:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E5=85=83=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9D=83=E5=A3=B0=E6=98=8E=E6=8E=A7?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- annotation-setting.yaml | 63 +++++++++++++++---- settings.yaml | 32 +++++----- .../post/copyright/copyright-default.html | 20 ++++-- .../modules/post/copyright/copyright-one.html | 8 ++- templates/post.html | 16 ++++- 5 files changed, 104 insertions(+), 35 deletions(-) diff --git a/annotation-setting.yaml b/annotation-setting.yaml index 67fbb1b7..cb5ce013 100644 --- a/annotation-setting.yaml +++ b/annotation-setting.yaml @@ -1,3 +1,42 @@ +apiVersion: v1alpha1 +kind: AnnotationSetting +metadata: + generateName: annotation-setting- +spec: + targetRef: + group: content.halo.run + kind: Post + formSchema: + - $formkit: "radio" + name: "copyrightEnable" + id: "copyrightEnable" + key: "copyrightEnable" + label: "显示版权声明" + value: "true" + options: + - label: "显示" + value: "true" + - label: "隐藏" + value: "false" + - $formkit: "radio" + name: "copyrightType" + if: "$get(copyrightEnable).value == 'true'" + label: "版权声明类型" + value: "original" + options: + - label: "原创" + value: "original" + - label: "转载" + value: "reprint" + - $formkit: "text" + name: "copyrightUrl" + if: "$get(copyrightEnable).value == 'true'" + label: "版权声明链接" + help: "默认后台设置链接" + placeholder: "请输入链接" + +--- + apiVersion: v1alpha1 kind: AnnotationSetting metadata: @@ -15,9 +54,9 @@ spec: value: "0" label: "该菜单的子菜单是否为垂直菜单" options: - - label: 是 + - label: "是" value: "1" - - label: 否 + - label: "否" value: "0" --- @@ -27,20 +66,20 @@ metadata: generateName: annotation-setting- spec: targetRef: - group: "core.halo.run" + group: core.halo.run kind: LinkGroup formSchema: - $formkit: "radio" name: "displayStyle" label: "分组方式" - value: default + value: "default" options: - - label: 默认 - value: default - - label: 美化 - value: beautify - - label: 失联 - value: deprecated + - label: "默认" + value: "default" + - label: "美化" + value: "beautify" + - label: "失联" + value: "deprecated" - $formkit: "textarea" name: "description" label: "描述" @@ -53,7 +92,7 @@ metadata: generateName: annotation-setting- spec: targetRef: - group: "core.halo.run" + group: core.halo.run kind: Link formSchema: - $formkit: "attachment" @@ -75,7 +114,7 @@ metadata: generateName: annotation-setting- spec: targetRef: - group: "core.halo.run" + group: core.halo.run kind: PhotoGroup formSchema: - $formkit: "attachment" diff --git a/settings.yaml b/settings.yaml index a7ec8fcf..07036566 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1421,27 +1421,29 @@ spec: - $formkit: group name: copyrights label: 版权声明 + help: 需要在发布文章时的元数据上选显示版权声明才可以生效 value: - enable: false - content: + content: '本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 程序员小航' + reprintContent: '本文是转载文章,版权归原作者所有。建议访问原文,转载本文请联系原作者。' children: - - $formkit: radio - name: enable - id: enable - key: enable - value: false - options: - - label: 打开 - value: true - - label: 关闭 - value: false - help: 文章底部显示版权声明模块 + - $formkit: "text" + name: "originalUrl" + label: "原创链接" + placeholder: "请输入链接" + - $formkit: "text" + name: "reprintUrl" + label: "转载链接" + placeholder: "请输入链接" - $formkit: textarea - if: $get(enable).value name: content - label: 声明内容 + label: 原创声明内容 placeholder: '本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 程序员小航' help: 支持 HTML 语法 + - $formkit: textarea + name: reprintContent + label: 转载声明内容 + placeholder: '本文是转载文章,版权归原作者所有。建议访问原文,转载本文请联系原作者。' + help: 支持 HTML 语法 - $formkit: select name: recommendQuantity label: 阅读建议 diff --git a/templates/modules/post/copyright/copyright-default.html b/templates/modules/post/copyright/copyright-default.html index 9710dbc3..a1971f0d 100644 --- a/templates/modules/post/copyright/copyright-default.html +++ b/templates/modules/post/copyright/copyright-default.html @@ -78,11 +78,18 @@ -
-
+
+
- 原创 + 转载
@@ -93,8 +100,11 @@
-
- +
+ +
diff --git a/templates/modules/post/copyright/copyright-one.html b/templates/modules/post/copyright/copyright-one.html index 79afd701..ccca7bde 100644 --- a/templates/modules/post/copyright/copyright-one.html +++ b/templates/modules/post/copyright/copyright-one.html @@ -72,8 +72,12 @@
-
- +
+ +
diff --git a/templates/post.html b/templates/post.html index a5feec49..d1943cca 100644 --- a/templates/post.html +++ b/templates/post.html @@ -16,7 +16,21 @@
- + + + +