支持自定义侧边栏

This commit is contained in:
liuzhihang 2022-10-29 22:14:08 +08:00
parent 9d47fe017b
commit 6a18943b9d
6 changed files with 28 additions and 7 deletions

View File

@ -122,9 +122,26 @@ spec:
label: "左侧"
- $formkit: textarea
name: widgets
label: 小部件(无效)
value: "profile,recent-posts,latest-comments,categories,tags"
help: "目前提供的小部件有profile站点资料, recent-posts近期文章, latest-comments最新评论, categories文章分类, tags文章标签。你可以随意组合或排序以逗号隔开。"
label: 小部件
value: "profile,wechat,comments,recent-posts,categories,tags-stat"
help: "目前提供的小部件有profile站点资料, wechat微信, recent-posts近期文章, comments最新评论, categories文章分类, tags文章标签, stat统计, tags-stat标签&统计)。你可以随意组合或排序,以逗号隔开。"
- $formkit: textarea
name: post_widgets
label: 文章页面小部件
value: "profile,wechat,toc,comments,recent-posts,categories,tags-stat"
help: "post 可以支持设置 toc "
- $formkit: textarea
name: tag_widgets
label: 标签页面小部件
value: "profile,wechat,comments,recent-posts,categories,tags-stat"
- $formkit: textarea
name: category_widgets
label: 分类页面小部件
value: "profile,wechat,comments,recent-posts,categories,tags-stat"
- $formkit: textarea
name: page_widgets
label: 自定义页面小部件
value: ""
- $formkit: text
name: profile_name
label: 个人卡片名称

View File

@ -66,7 +66,7 @@
<div class="pagination"><span class="page-number current">1</span></div>
</nav>
</div>
<div th:replace="modules/aside :: aside('profile,recent-posts,tags-stat')"></div>
<div th:replace="modules/aside :: aside(${theme.config.sidebar.category_widgets})"></div>
</main>
<!-- 底部 -->

View File

@ -24,7 +24,7 @@
<th:block th:replace="modules/post-list :: post-list"></th:block>
</div>
<div th:replace="modules/aside :: aside('profile,wechat,comments,recent-posts,categories,tags-stat')"></div>
<div th:replace="modules/aside :: aside(${theme.config.sidebar.widgets})"></div>
</main>
<!-- 底部 -->
<footer th:replace="modules/footer :: footer"></footer>

View File

@ -13,6 +13,10 @@
<div id="page">
<div id="article-container line-numbers" th:utext="${singlePage.content.content}"></div>
</div>
<!-- 侧栏 -->
<div th:replace="modules/aside :: aside(${theme.config.sidebar.page_widgets})"></div>
</main>
<!-- 底部 -->
<footer th:replace="modules/footer :: footer"></footer>

View File

@ -230,7 +230,7 @@
</div>
<!-- 侧栏 -->
<div th:replace="modules/aside :: aside('profile,toc,recent-posts,tags-stat')"></div>
<div th:replace="modules/aside :: aside(${theme.config.sidebar.post_widgets})"></div>
</main>
<!-- 底部 -->

View File

@ -50,7 +50,7 @@
<div class="pagination"><span class="page-number current">1</span></div>
</nav>
</div>
<div th:replace="modules/aside :: aside('profile,recent-posts,tags-stat')"></div>
<div th:replace="modules/aside :: aside(${theme.config.sidebar.tag_widgets})"></div>
</main>
<!-- 底部 -->