文章元数据添加ai摘要控制

This commit is contained in:
1152958806@qq.com 2023-09-23 14:14:17 +08:00
parent a5f21be2f9
commit 68e97454fc
2 changed files with 13 additions and 2 deletions

View File

@ -7,6 +7,15 @@ spec:
group: content.halo.run
kind: Post
formSchema:
- $formkit: "radio"
name: "ai"
label: "AI 摘要"
help: "默认后台设置"
options:
- label: "启用"
value: "true"
- label: "禁用"
value: "false"
- $formkit: "radio"
name: "copyrightEnable"
id: "copyrightEnable"

View File

@ -136,7 +136,8 @@
<!-- 文章ai摘要 -->
<div class="post-ai" th:if="${theme.config.post.aiDescription.aiDescriptionEnable}">
<div class="post-ai" th:if="${not #strings.isEmpty(#annotations.get(post, 'ai')) ?
#annotations.get(post, 'ai') == 'true' : theme.config.post.aiDescription.aiDescriptionEnable}">
<div class="ai-title"><i class="haofont hao-icon-bilibili"></i>
<div class="ai-title-text">AI-摘要</div>
<div th:if="${theme.config.post.aiDescription.switchBtn}" id="ai-Toggle">切换</div>
@ -159,7 +160,8 @@
</article>
<!-- 文章ai摘要 -->
<script data-pjax th:if="${theme.config.post.aiDescription.aiDescriptionEnable}"
<script data-pjax th:if="${not #strings.isEmpty(#annotations.get(post, 'ai')) ?
#annotations.get(post, 'ai') == 'true' : theme.config.post.aiDescription.aiDescriptionEnable}"
th:src="${assets_link + '/libs/gpt/post-ai.js'}"></script>
<!-- 版权声明 -->