mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-16 00:49:40 +08:00
40 lines
1.9 KiB
HTML
40 lines
1.9 KiB
HTML
<div xmlns:th="https://www.thymeleaf.org"
|
|
th:fragment="widget (sidebar)"
|
|
th:class="'card widget tagcloud ' + ${sidebar.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_tagcloud_color}">
|
|
|
|
<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>
|
|
</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 != 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>
|
|
</div>
|
|
|
|
<th:block th:if="${theme.config.sidebar.show_tagcloud_style}">
|
|
<script th:src="@{/assets/js/tagcloud.min.js(mew=${theme.spec.version})}"></script>
|
|
<script>
|
|
$(function(){ tagcloud({
|
|
selector: '.tagcloud .card-content',
|
|
fontsize: 18,
|
|
radius: 75,
|
|
mspeed: 'slow',
|
|
ispeed: 'slow',
|
|
direction: 45,
|
|
keep: false
|
|
}) })
|
|
</script>
|
|
</th:block>
|
|
</div>
|