halo-theme-hao/templates/modules/aside.html
2024-04-12 14:35:37 +08:00

39 lines
1.5 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!-- 侧边栏 -->
<div class="aside-content" id="aside-content" th:fragment="aside(widgets)"
th:if="${theme.config.sidebar.location != 'hide-aside' && not #strings.isEmpty(widgets)}">
<!-- 侧栏部件,不包含 toc 则直接遍历 -->
<th:block th:if="${not #strings.contains(widgets, 'toc')}">
<th:block th:each="widget,iterStat : ${#strings.listSplit(widgets, ',')}">
<th:block th:if="not ${iterStat.last}">
<th:block th:replace="~{'modules/widgets/aside/'+ ${widget}}"/>
</th:block>
<th:block th:if="${iterStat.last}">
<div class="sticky_layout">
<th:block th:replace="~{'modules/widgets/aside/'+ ${widget}}"/>
</div>
</th:block>
</th:block>
</th:block>
<!-- 侧栏部件toc 之后的组件需要被 sticky_layout 包裹 -->
<th:block th:if="${#strings.contains(widgets, 'toc')}">
<th:block th:each="widget : ${#strings.listSplit(#strings.substringBefore(widgets, 'toc'), ',')}">
<th:block th:replace="~{'modules/widgets/aside/'+ ${widget}}"/>
</th:block>
<!-- toc 之后的组件需要被 sticky_layout 包裹 -->
<div class="sticky_layout">
<th:block th:replace="~{modules/widgets/aside/toc}"/>
<th:block th:each="widget : ${#strings.listSplit(#strings.substringAfter(widgets, 'toc'), ',')}">
<th:block th:replace="~{'modules/widgets/aside/'+ ${widget}}"/>
</th:block>
</div>
</th:block>
</div>