diff --git a/annotation-setting.yaml b/annotation-setting.yaml index cb5ce013..93e4f281 100644 --- a/annotation-setting.yaml +++ b/annotation-setting.yaml @@ -12,7 +12,7 @@ spec: id: "copyrightEnable" key: "copyrightEnable" label: "显示版权声明" - value: "true" + help: "默认后台设置" options: - label: "显示" value: "true" @@ -20,9 +20,9 @@ spec: value: "false" - $formkit: "radio" name: "copyrightType" - if: "$get(copyrightEnable).value == 'true'" label: "版权声明类型" value: "original" + if: "$get(copyrightEnable).value != 'false'" options: - label: "原创" value: "original" @@ -30,9 +30,9 @@ spec: value: "reprint" - $formkit: "text" name: "copyrightUrl" - if: "$get(copyrightEnable).value == 'true'" label: "版权声明链接" - help: "默认后台设置链接" + help: "默认后台设置" + if: "$get(copyrightEnable).value != 'false'" placeholder: "请输入链接" --- diff --git a/settings.yaml b/settings.yaml index 95413fd5..f51e9ccd 100644 --- a/settings.yaml +++ b/settings.yaml @@ -1422,14 +1422,23 @@ spec: content: '本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 程序员小航' reprintContent: '本文是转载文章,版权归原作者所有。建议访问原文,转载本文请联系原作者。' children: - - $formkit: "text" - name: "originalUrl" - label: "原创链接" - placeholder: "请输入链接" - - $formkit: "text" - name: "reprintUrl" - label: "转载链接" - placeholder: "请输入链接" + - $formkit: radio + name: 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 name: content label: 原创声明内容 diff --git a/templates/modules/post/copyright/copyright-default.html b/templates/modules/post/copyright/copyright-default.html index a1971f0d..c05e55fa 100644 --- a/templates/modules/post/copyright/copyright-default.html +++ b/templates/modules/post/copyright/copyright-default.html @@ -79,7 +79,8 @@
+ copyrightEnable = ${not #strings.isEmpty(#annotations.get(post, 'copyrightEnable')) ? + #annotations.get(post, 'copyrightEnable') == 'true' : theme.config.post.copyrights.enable}">
-
+ th:if="${not #strings.isEmpty(#annotations.get(post, 'copyrightEnable')) ? + #annotations.get(post, 'copyrightEnable') == 'true' : theme.config.post.copyrights.enable}">