<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- 标签 -->
<th:block th:fragment="tags-contain"
          th:with="tags = ${tagFinder.listAll()}, tagQuantity = ${#conversions.convert(theme.config.sidebar.tagQuantity, 'java.lang.Integer')}">

    <div class="item-headline"><i class="iconfont icon-tags"></i><span>标签</span></div>
    <div class="card-tag-cloud">
        <a class="tag-item" style="font-size:1em" th:each="tag,iterStat : ${tags}"
           th:href="@{${tag.status.permalink}}"
           th:if="${tagQuantity >= 0 && iterStat.index < tagQuantity || tagQuantity < 0}"
           th:title="${tag.spec.displayName}">
            <!-- 角标 -->
            [[${tag.spec.displayName}]]<sup th:text="${tag.status.visiblePostCount}"></sup>
        </a>
    </div>
    <script th:if="${theme.config.other.tagRandomColorEnable}">
        for (const tag of document.getElementsByClassName('tag-item')) {
            let randomColor ="#"+((1<<24)*Math.random()|0).toString(16);
            tag.style.color = randomColor;
        }
    </script>

</th:block>


</html>
