增加评论加载方式配置,移除评论插件安装检测,允许安装其他评论插件并设为默认评论

This commit is contained in:
j m 2024-09-15 20:01:45 +08:00
parent 04a6375aec
commit 0dcad3e160
7 changed files with 20 additions and 10 deletions

View File

@ -1256,6 +1256,16 @@ spec:
label: 开启 label: 开启
- value: false - value: false
label: 关闭 label: 关闭
- $formkit: radio
name: enable_comment_type
label: 评论加载方式
value: true
help: '在使用Halo评论组件时建议您关闭Pjax加载功能以获得最佳体验。同时Halo评论组件支持评论插件的新特性。而对于Web评论组件它支持Pjax加载但请注意部分新特性可能不被Web评论组件所支持。'
options:
- value: true
label: Halo评论组件
- value: false
label: Web评论组件
- $formkit: radio - $formkit: radio
name: effects_lantern_mode name: effects_lantern_mode
id: effects_lantern_mode id: effects_lantern_mode

View File

@ -2,7 +2,7 @@
th:class="${theme.config.basic_style.theme_style}" th:class="${theme.config.basic_style.theme_style}"
th:fragment="layout (title, canonical, content, isPost)"> th:fragment="layout (title, canonical, content, isPost)">
<th:block th:with="contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)}, <th:block th:with="contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)},
enableComment = ${baseEnableComment == true && site.comment.enable && pluginFinder.available('PluginCommentWidget')}"> enableComment = ${baseEnableComment == true && site.comment.enable}">
<th:block th:with="stats = ${siteStatsFinder.getStats()}"> <th:block th:with="stats = ${siteStatsFinder.getStats()}">
<th:block th:replace="~{common/head :: head}"/> <th:block th:replace="~{common/head :: head}"/>

View File

@ -49,7 +49,7 @@
</div> </div>
<div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}"> <div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}">
<h3 class="comment-title">评论</h3> <h3 class="comment-title">评论</h3>
<th:block th:if="${theme.config.enhance.enable_pjax}"> <th:block th:unless="${theme.config.enhance.enable_comment_type}">
<th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}"> <th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}">
<comment-widget <comment-widget
group="content.halo.run" group="content.halo.run"
@ -69,7 +69,7 @@
></comment-widget> ></comment-widget>
</th:block> </th:block>
</th:block> </th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}"> <th:block th:if="${theme.config.enhance.enable_comment_type}">
<th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}"> <th:block th:if="${theme.config.page_config.link_enable_comment == 'custom'}">
<halo:comment <halo:comment
group="content.halo.run" group="content.halo.run"

View File

@ -92,7 +92,7 @@
<div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}"> <div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}">
<h3 class="comment-title">评论</h3> <h3 class="comment-title">评论</h3>
<th:block th:if="${theme.config.enhance.enable_pjax}"> <th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget <comment-widget
group="content.halo.run" group="content.halo.run"
th:kind="${type}" th:kind="${type}"
@ -101,7 +101,7 @@
with-replies="false" with-replies="false"
></comment-widget> ></comment-widget>
</th:block> </th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}"> <th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment <halo:comment
group="content.halo.run" group="content.halo.run"
th:kind="${type}" th:kind="${type}"

View File

@ -57,7 +57,7 @@
</div> </div>
</div> </div>
<div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}"> <div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}">
<th:block th:if="${theme.config.enhance.enable_pjax}"> <th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget <comment-widget
group="moment.halo.run" group="moment.halo.run"
kind="Moment" kind="Moment"
@ -66,7 +66,7 @@
with-replies="false" with-replies="false"
></comment-widget> ></comment-widget>
</th:block> </th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}"> <th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment <halo:comment
group="moment.halo.run" group="moment.halo.run"
kind="Moment" kind="Moment"

View File

@ -68,7 +68,7 @@
</div> </div>
</div> </div>
<div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}"> <div class="journal-comment comment-wrapper-z-index" th:if="${enableComment}">
<th:block th:if="${theme.config.enhance.enable_pjax}"> <th:block th:unless="${theme.config.enhance.enable_comment_type}">
<comment-widget <comment-widget
group="moment.halo.run" group="moment.halo.run"
kind="Moment" kind="Moment"
@ -77,7 +77,7 @@
with-replies="false" with-replies="false"
></comment-widget> ></comment-widget>
</th:block> </th:block>
<th:block th:unless="${theme.config.enhance.enable_pjax}"> <th:block th:if="${theme.config.enhance.enable_comment_type}">
<halo:comment <halo:comment
group="moment.halo.run" group="moment.halo.run"
kind="Moment" kind="Moment"

View File

@ -30,7 +30,7 @@ spec:
settingName: theme-dream2-plus-setting settingName: theme-dream2-plus-setting
configMapName: theme-dream2-plus-configMap configMapName: theme-dream2-plus-configMap
# 版本号 # 版本号
version: 1.2.9.beta1 version: 1.3.0
# 最低支持的 Halo 版本 # 最低支持的 Halo 版本
require: ">=2.19.0" require: ">=2.19.0"
# 许可 # 许可