23 lines
1.4 KiB
HTML
Raw Normal View History

2023-03-23 18:25:48 +08:00
<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (sidebar)"
th:class="'card widget tagcloud ' + ${sidebar.hide}"
2023-03-25 16:28:00 +08:00
th:with="num = ${#strings.isEmpty(theme.config.sidebar.tags_num)? 32 : T(java.lang.Integer).parseInt(theme.config.sidebar.tags_num)},
2023-03-24 20:25:04 +08:00
tags = ${tagFinder.list(1,num)},
isEmpty = ${#lists.isEmpty(tags)},
enableTagsColor = ${theme.config.sidebar.enable_tagcloud_color}">
2023-03-23 18:25:48 +08:00
<div class="card-title">
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-cloud-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '标签云')}"></span>
<a th:if="${theme.config.sidebar.tagcloud_more}" class="card-more" th:href="@{/tags}">更多<i class="ri-arrow-right-double-line"></i></a>
2023-03-23 18:25:48 +08:00
</div>
<div th:if="${isEmpty}" class="card-empty">暂无标签</div>
2024-03-22 08:28:16 +08:00
<div th:unless="${isEmpty}" class="card-content">
2023-03-23 18:25:48 +08:00
<a
th:each="tag : ${tags}"
th:href="@{${tag.status.permalink}}"
2023-03-24 20:25:04 +08:00
th:text="${tag.spec.displayName}"
2024-04-21 08:03:18 +08:00
th:with="size = ${#strings.length(tag.spec.displayName) + #strings.length(tag.spec.slug) + (tag.postCount != null ? tag.postCount : 0)}"
th:style="'font-size: ' + ${size < 14 ? 14 : size > 32 ? 32 : size} + 'px;' + ${(enableTagsColor && tag.spec.color != '#ffffff')? 'color: ' + tag.spec.color +';' : ''}"></a>
2023-03-23 18:25:48 +08:00
</div>
</div>