2023-03-25 16:28:00 +08:00

22 lines
1.2 KiB
HTML

<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget tagcloud ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.tags_num)? 32 : T(java.lang.Integer).parseInt(theme.config.sidebar.tags_num)},
tags = ${tagFinder.list(1,num)},
isEmpty = ${#lists.isEmpty(tags)},
enableTagsColor = ${theme.config.sidebar.enable_tag_color}">
<div class="card-title">
<i class="fa fa-cloud card-title-label"></i><span>标签云</span>
<a th:if="${tags.hasNext}" class="card-more" th:href="@{/tags}">更多<i class="fa fa-angle-double-right"></i></a>
</div>
<div th:if="${isEmpty}" class="card-empty">暂无标签</div>
<div th:unless="${isEmpty}" class="card-content">
<a
th:each="tag : ${tags}"
th:href="@{${tag.status.permalink}}"
th:text="${tag.spec.displayName}"
th:with="size = ${#strings.length(tag.spec.displayName) + #strings.length(tag.spec.slug) + tag.postCount}"
th:style="'font-size: ' + ${size < 14 ? 14 : size > 32 ? 32 : size} + 'px;' + ${enableTagsColor? 'color: ' + tag.spec.color +';' : ''}"></a>
</div>
</div>