Skip to content

Commit

Permalink
# add post toc -3.
Browse files Browse the repository at this point in the history
  • Loading branch information
PG-Z committed Jun 4, 2024
1 parent 25cc67a commit 7559281
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.2.2-beta.4
version=1.2.2
16 changes: 13 additions & 3 deletions settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,28 @@ spec:
label: 主题favicon
help: 注意:[Halo >> 设置 >> favicon]优先级更高
value: https://s2.loli.net/2024/05/29/YeBxEhvcPzpmD8u.png
- group: post
label: 文章详情
- group: toc
label: 文章目录
formSchema:
- $formkit: radio
name: toc
name: switch
label: 目录展示
value: false
options:
- value: true
label: 展示
- value: false
label: 隐藏
- $formkit: attachment
name: js
label: JS 地址
help: 文章目录生成JS, 默认为[tocbot.min.js], 可以替换为自定义JS文件
value: https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.27.4/tocbot.min.js
- $formkit: attachment
name: css
label: CSS 地址
help: 文章目录生成CSS, 默认为[tocbot.css], 可以替换为自定义css文件
value: https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.27.4/tocbot.css
- group: beian
label: 备案信息
formSchema:
Expand Down
6 changes: 3 additions & 3 deletions templates/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
th:replace="~{modules/layout :: html(title = ${post.spec.title}, content = ~{::content}, _head = ~{::head}, _plugins = ~{::plugins})}"
>

<th:block th:if="${theme.config.post.toc}" th:fragment="plugins">
<script src="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.27.4/tocbot.min.js"></script>
<th:block th:if="${theme.config.toc.switch}" th:fragment="plugins">
<script th:src="${theme.config.toc.js}"></script>
<script th:src="@{/assets/dist/plugins/tocmain.js?v={version}(version=${theme.spec.version})}"></script>
<link rel="stylesheet" th:href="@{/assets/dist/plugins/tocmain.css?v={version}(version=${theme.spec.version})}" href="./assets/dist/plugins/tocmain.css"/>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tocbot/4.27.4/tocbot.css">
<link rel="stylesheet" th:href="${theme.config.toc.css}">
</th:block>

<th:block th:fragment="content">
Expand Down
2 changes: 1 addition & 1 deletion theme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ spec:
website: https://aiheiyo.top
settingName: "Summer-Cat-setting"
configMapName: "Summer-Cat-configMap"
version: 1.2.2-beta.4
version: 1.2.2
require: 2.15.0

0 comments on commit 7559281

Please sign in to comment.