mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-16 04:19:41 +08:00
29 lines
1.6 KiB
HTML
29 lines
1.6 KiB
HTML
<div xmlns:th="https://www.thymeleaf.org"
|
|
th:fragment="widget (hide)"
|
|
th:class="'card widget ' + ${hide}"
|
|
th:with="num = ${#strings.isEmpty(theme.config.sidebar.categories_num)? 10 : T(java.lang.Integer).parseInt(theme.config.sidebar.categories_num)},
|
|
categories = ${categoryFinder.listAsTree()},
|
|
isEmpty = ${#lists.isEmpty(categories)}">
|
|
<div class="card-title">
|
|
<i class="ri-apps-line card-title-label"></i><span>分类</span>
|
|
<a th:if="${#lists.size(categories) > num && theme.config.sidebar.categories_more}" class="card-more" th:href="@{/categories}">更多<i
|
|
class="ri-arrow-right-double-line"></i></a>
|
|
</div>
|
|
<div th:if="${isEmpty}" class="card-empty">暂无分类</div>
|
|
<div th:unless="${isEmpty}" class="card-content">
|
|
<ul class="menu-list">
|
|
<th:block th:fragment="categories (categories, noLimit)">
|
|
<li th:each="category,itemIndex : ${categories}" th:unless="${itemIndex.index >= num && noLimit == null}">
|
|
<a class="level is-marginless" th:href="${category.status.permalink}">
|
|
<span class="level-item" th:text="${category.spec.displayName}"></span>
|
|
<span class="level-item tag" th:text="${category.status.postCount}"></span>
|
|
</a>
|
|
<ul th:if="${!#lists.isEmpty(category.children)}">
|
|
<th:block th:replace="~{:: categories (${category.children}, true)}"/>
|
|
</ul>
|
|
</li>
|
|
</th:block>
|
|
</ul>
|
|
</div>
|
|
</div>
|