mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 17:49:40 +08:00
perf(comment): 允许全局关闭评论,文章、页面评论设置生效,#64
This commit is contained in:
parent
7c7b5e98bf
commit
b480a428cc
@ -1,45 +1,46 @@
|
||||
<html lang="zh" xmlns:th="https://www.thymeleaf.org"
|
||||
th:class="${theme.config.basic_style.theme_style}"
|
||||
th:fragment="layout (title, canonical, content, isPost)">
|
||||
<th:block th:if="${!#strings.equals('',param._pjax)}"
|
||||
th:with="contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)}">
|
||||
<th:block th:replace="~{common/head :: head}"/>
|
||||
<body>
|
||||
<div class="column-main">
|
||||
<th:block th:replace="${content}"/>
|
||||
</div>
|
||||
<th:block th:replace="~{common/scripts}"/>
|
||||
</body>
|
||||
</th:block>
|
||||
<th:block th:unless="${!#strings.equals('',param._pjax)}"
|
||||
th:with="stats = ${siteStatsFinder.getStats()},
|
||||
contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)}">
|
||||
<th:block th:replace="~{common/head :: head}"/>
|
||||
<body>
|
||||
<th:block th:replace="~{common/navbar}"/>
|
||||
<th:block th:if="${theme.config.basic_style.enable_banner}">
|
||||
<th:block th:replace="~{common/banner :: banner}"/>
|
||||
</th:block>
|
||||
<section class="section">
|
||||
<div th:class="${theme.config.basic_style.sidebar_column != 'all' ? 'container two-column' : 'container' }">
|
||||
<div class="columns">
|
||||
<div class="column column-main">
|
||||
<th:block th:replace="${content}"/>
|
||||
</div>
|
||||
<th:block
|
||||
th:if="${theme.config.basic_style.sidebar_column!='only-right' && theme.config.basic_style.sidebar_column!='module-left'}">
|
||||
<th:block th:replace="~{common/widget :: widget('left')}"/>
|
||||
</th:block>
|
||||
<th:block
|
||||
th:if="${theme.config.basic_style.sidebar_column!='only-left' && theme.config.basic_style.sidebar_column!='module-right'}">
|
||||
<th:block th:replace="~{common/widget :: widget('right')}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
<th:block th:with="contributor = ${contributorFinder.getContributor(theme.config.basic_info.metadata_name)},
|
||||
enableComment = ${baseEnableComment && site.comment.enable && pluginFinder.available('PluginCommentWidget')}">
|
||||
<th:block th:if="${!#strings.equals('',param._pjax)}">
|
||||
<th:block th:replace="~{common/head :: head}"/>
|
||||
<body>
|
||||
<div class="column-main">
|
||||
<th:block th:replace="${content}"/>
|
||||
</div>
|
||||
</section>
|
||||
<th:block th:replace="~{common/actions}"/>
|
||||
<th:block th:replace="~{common/footer}"/>
|
||||
<th:block th:replace="~{common/scripts}"/>
|
||||
</body>
|
||||
<th:block th:replace="~{common/scripts}"/>
|
||||
</body>
|
||||
</th:block>
|
||||
<th:block th:unless="${!#strings.equals('',param._pjax)}"
|
||||
th:with="stats = ${siteStatsFinder.getStats()}">
|
||||
<th:block th:replace="~{common/head :: head}"/>
|
||||
<body>
|
||||
<th:block th:replace="~{common/navbar}"/>
|
||||
<th:block th:if="${theme.config.basic_style.enable_banner}">
|
||||
<th:block th:replace="~{common/banner :: banner}"/>
|
||||
</th:block>
|
||||
<section class="section">
|
||||
<div th:class="${theme.config.basic_style.sidebar_column != 'all' ? 'container two-column' : 'container' }">
|
||||
<div class="columns">
|
||||
<div class="column column-main">
|
||||
<th:block th:replace="${content}"/>
|
||||
</div>
|
||||
<th:block
|
||||
th:if="${theme.config.basic_style.sidebar_column!='only-right' && theme.config.basic_style.sidebar_column!='module-left'}">
|
||||
<th:block th:replace="~{common/widget :: widget('left')}"/>
|
||||
</th:block>
|
||||
<th:block
|
||||
th:if="${theme.config.basic_style.sidebar_column!='only-left' && theme.config.basic_style.sidebar_column!='module-right'}">
|
||||
<th:block th:replace="~{common/widget :: widget('right')}"/>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<th:block th:replace="~{common/actions}"/>
|
||||
<th:block th:replace="~{common/footer}"/>
|
||||
<th:block th:replace="~{common/scripts}"/>
|
||||
</body>
|
||||
</th:block>
|
||||
</th:block>
|
||||
</html>
|
@ -14,9 +14,7 @@
|
||||
<script th:if="${isJournals}" data-pjax th:src="@{/assets/js/journals.min.js(mew=${theme.spec.version})}"></script>
|
||||
</th:block>
|
||||
<script th:if="${isPhotos}" data-pjax th:src="@{/assets/lib/justifiedGallery@3.8.1/jquery.justifiedGallery.min.js}"></script>
|
||||
<th:block th:if="${isPost || enableComment != null}">
|
||||
<script th:if="${pluginFinder.available('PluginCommentWidget') && (post != null || singlePage != null || enableComment != null)}" data-pjax src="/plugins/PluginCommentWidget/assets/static/comment-widget.iife.js"></script>
|
||||
</th:block>
|
||||
<script th:if="${enableComment}" data-pjax src="/plugins/PluginCommentWidget/assets/static/comment-widget.iife.js"></script>
|
||||
|
||||
<script th:src="@{/assets/js/mew-custom.min.js(mew=${theme.spec.version})}"></script>
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<th:block xmlns:th="https://www.thymeleaf.org"
|
||||
th:insert="~{common/layout :: layout (title = '友链 - ' + ${site.title}, canonical = @{/links}, content = ~{::content}, isPost = false)}"
|
||||
th:with="enableComment = ${!#strings.isEmpty(theme.config.page_config.link_comment_id)}">
|
||||
th:with="baseEnableComment = ${!#strings.isEmpty(theme.config.page_config.link_comment_id)}">
|
||||
<th:block th:fragment="content"
|
||||
th:with="defaultAvatar = ${#strings.defaultString(theme.config.page_config.links_default_avatar, #theme.assets('/img/avatar.svg'))}">
|
||||
<div class="card">
|
||||
@ -46,7 +46,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${pluginFinder.available('PluginCommentWidget') && enableComment}">
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${enableComment}">
|
||||
<h3 class="comment-title">评论</h3>
|
||||
<div class="widget-comment" th:data-id="${theme.config.page_config.link_comment_id}" data-target="SinglePage"></div>
|
||||
</div>
|
||||
|
@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${pluginFinder.available('PluginCommentWidget')}">
|
||||
<div class="card card-content" id="comment-wrapper" th:if="${enableComment}">
|
||||
<h3 class="comment-title">评论</h3>
|
||||
<div class="widget-comment" th:data-id="${post.metadata.name}" th:data-target="${type}"></div>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<!DOCTYPE html>
|
||||
<th:block
|
||||
th:insert="~{common/layout :: layout (title = '瞬间 - ' + ${site.title}, canonical = @{/moments}, content = ~{::content}, isPost = true)}"
|
||||
th:with="isJournals = true, enableShare = ${theme.config.post.enable_post_share}, enableComment = ${theme.config.page_config.enable_journals_comment}"
|
||||
th:with="isJournals = true, enableShare = ${theme.config.post.enable_post_share}, baseEnableComment = ${theme.config.page_config.enable_journals_comment}"
|
||||
xmlns:th="https://www.thymeleaf.org">
|
||||
<th:block th:fragment="content">
|
||||
<div class="card card-content journal" th:each="moment : ${moments.items}">
|
||||
@ -37,7 +37,7 @@
|
||||
<a class="share"><i class="ri-share-forward-line"></i><em>分享</em></a>
|
||||
</span>
|
||||
</div>
|
||||
<div class="journal-comment" th:if="${enableComment && pluginFinder.available('PluginCommentWidget')}">
|
||||
<div class="journal-comment" th:if="${enableComment}">
|
||||
<div class="widget-comment" data-target="Moment" th:data-id="${moment.metadata.name}"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,5 +4,6 @@
|
||||
th:with="enableKatex = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_katex'))? singlePage.metadata.annotations.get('enable_katex') : theme.config.post.enable_katex},
|
||||
enableShare = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_share'))? singlePage.metadata.annotations.get('enable_share') : theme.config.post.enable_post_share},
|
||||
enableCopyright = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_copyright'))? singlePage.metadata.annotations.get('enable_copyright') : theme.config.post.enable_copyright},
|
||||
enableDonate = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_donate'))? singlePage.metadata.annotations.get('enable_donate') : theme.config.post.enable_post_donate}">
|
||||
enableDonate = ${!#strings.isEmpty(singlePage.metadata.annotations.get('enable_donate'))? singlePage.metadata.annotations.get('enable_donate') : theme.config.post.enable_post_donate},
|
||||
baseEnableComment = ${singlePage.spec.allowComment}">
|
||||
</th:block>
|
||||
|
@ -4,5 +4,6 @@
|
||||
th:with="enableKatex = ${!#strings.isEmpty(post.metadata.annotations.get('enable_katex'))? post.metadata.annotations.get('enable_katex') : theme.config.post.enable_katex},
|
||||
enableShare = ${!#strings.isEmpty(post.metadata.annotations.get('enable_share'))? post.metadata.annotations.get('enable_share') : theme.config.post.enable_post_share},
|
||||
enableCopyright = ${!#strings.isEmpty(post.metadata.annotations.get('enable_copyright'))? post.metadata.annotations.get('enable_copyright') : theme.config.post.enable_copyright},
|
||||
enableDonate = ${!#strings.isEmpty(post.metadata.annotations.get('enable_donate'))? post.metadata.annotations.get('enable_donate') : theme.config.post.enable_post_donate}">
|
||||
enableDonate = ${!#strings.isEmpty(post.metadata.annotations.get('enable_donate'))? post.metadata.annotations.get('enable_donate') : theme.config.post.enable_post_donate},
|
||||
baseEnableComment = ${post.spec.allowComment}">
|
||||
</th:block>
|
||||
|
Loading…
x
Reference in New Issue
Block a user