评论代码优化
This commit is contained in:
parent
74a640a048
commit
2b888254a1
|
@ -136,23 +136,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- 评论模块 -->
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:if="${theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment"
|
||||
th:if="${pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage"
|
||||
th:attr="name=${singlePage.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'SinglePage',
|
||||
name = ${singlePage.metadata.name})}"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -14,20 +14,11 @@
|
|||
<th:block th:replace="~{macro/content-links :: content-links(${htmlType})}" />
|
||||
|
||||
<hr/>
|
||||
<!-- 评论模块 -->
|
||||
<th:block th:if="${theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment" th:if="${pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name='links'" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'SinglePage',
|
||||
name = 'links')}"/>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||
<th:block th:fragment="comment(group, kind, name)">
|
||||
<th:block
|
||||
th:if="${theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<!-- 已知问题 PJAX 下,comment 首次请求会出错。当前的临时解决办法是使用 js 重试 -->
|
||||
<div id="post-comment"
|
||||
th:if="${pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment th:attr="name=${name},kind=${kind},group=${group}" colorScheme="document.documentElement.getAttribute('data-theme')"/>
|
||||
</div>
|
||||
</th:block>
|
||||
</html>
|
|
@ -70,23 +70,11 @@
|
|||
</div>
|
||||
<script>heo.reflashEssayWaterFall();</script>
|
||||
<hr/>
|
||||
<!-- 评论模块 -->
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:if="${theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment"
|
||||
th:if="${pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name='moments'"
|
||||
colorScheme="document.documentElement.getAttribute('data-theme')"/>
|
||||
</div>
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'SinglePage',
|
||||
name = 'moments')}"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -13,23 +13,12 @@
|
|||
<div id="page">
|
||||
<div id="article-container" th:utext="${singlePage.content.content}"></div>
|
||||
<hr>
|
||||
<!-- 评论模块 -->
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:if="${singlePage.spec.allowComment && theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment"
|
||||
th:if="${singlePage.spec.allowComment && pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage"
|
||||
th:attr="name=${singlePage.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'SinglePage',
|
||||
name = ${singlePage.metadata.name})}"/>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 侧栏 -->
|
||||
|
|
|
@ -16,20 +16,11 @@
|
|||
|
||||
|
||||
<hr/>
|
||||
<!-- 评论模块 -->
|
||||
<th:block th:if="${theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment" th:if="${pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name=${singlePage.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'SinglePage',
|
||||
name = ${singlePage.metadata.name})}"/>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
|
|
|
@ -272,22 +272,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<!-- 评论模块 -->
|
||||
<!--/* 评论组件 */-->
|
||||
<th:block
|
||||
th:if="${post.spec.allowComment && theme.config.comments.twikooEnable && #strings.equals(theme.config.comments.use, 'Twikoo') && not #strings.isEmpty(theme.config.comments.twikoos.envId)}">
|
||||
<div th:replace="~{modules/twikoo :: twikoo}"></div>
|
||||
</th:block>
|
||||
<div id="post-comment"
|
||||
th:if="${post.spec.allowComment && pluginFinder.available('PluginCommentWidget') && #strings.equals(theme.config.comments.use, 'commentWidget')}">
|
||||
<div class="comment-head">
|
||||
<div class="comment-headline"><i class="iconfont icon-comment-alt"></i> <span>评论</span></div>
|
||||
<div class="comment-privacy"><a href="/privacy">隐私政策</a></div>
|
||||
<div class="comment-tips" id="comment-tips">
|
||||
<span>你无需删除空行,直接评论以获取最佳展示效果</span>
|
||||
</div>
|
||||
</div>
|
||||
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" colorScheme="document.documentElement.getAttribute('data-theme')" />
|
||||
</div>
|
||||
th:replace="~{modules/comment :: comment(group = 'content.halo.run',
|
||||
kind = 'Post',
|
||||
name = ${post.metadata.name})}"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue