Skip to content

Commit

Permalink
链接页面支持插入内容。
Browse files Browse the repository at this point in the history
为页面添加友情链接模板,以支持在友情链接页面添加评论。
  • Loading branch information
chengzhongxue committed Aug 29, 2024
1 parent f7e66f9 commit ec45123
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
20 changes: 20 additions & 0 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,25 @@ spec:
value: /themes/theme-iemo/assets/images/random/cover-post-1.jpg
accepts:
- "image/*"
-
- group: plugin
label: 插件适配
formSchema:
- $formkit: group
name: links
label: 链接插件
value:
enable_comment: false
children:
- $formkit: checkbox
name: enable_comment
label: 启用评论
help: "启用链接插件原生适配的评论组件,需要链接插件 >= 1.4.0 版本"
- $formkit: code
label: 页面内容
language: html
height: 400px
name: content
help: 页面底部内容,可以用于填写申请信息,支持 HTML


9 changes: 7 additions & 2 deletions templates/links.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
<div class="content">
<article>
<h2>友人帐 <span>Links.</span></h2>
<div class="single" th:unless="${#strings.isEmpty(theme.config.plugin.links.content)}">
<div class="post-content" th:utext="${theme.config.plugin.links.content}"></div>
</div>
<div class="link-box">
<ul>
<th:block th:each="group,iterStat : ${groups}">
Expand All @@ -26,8 +29,10 @@ <h3 th:text="${link.spec.displayName}"></h3>
</th:block>
</ul>
</div>
<th:block
th:replace="~{modules/inc/halo-comment :: halo-comment(name=${pluginName},kind='Plugin',group='plugin.halo.run')}">
<th:block class="comment-widget" th:if="${theme.config.plugin.links.enable_comment}">
<th:block
th:replace="~{modules/inc/halo-comment :: halo-comment(name=${pluginName},kind='Plugin',group='plugin.halo.run')}">
</th:block>
</th:block>
</article>
<th:block th:replace="~{modules/aside}" />
Expand Down

0 comments on commit ec45123

Please sign in to comment.