UNPKG

halo-theme-dream2.0-plus

Version:

梦之城,童话梦境,动漫类型博客主题。

65 lines (64 loc) 4.77 kB
<div xmlns:th="https://www.thymeleaf.org" th:fragment="widget (sidebar)" th:class="'card widget profile ' + ${sidebar.hide}"> <div class="card-content"> <nav class="level"> <div class="level-item" style="flex-direction: column;"> <figure class="image"> <img class="avatar" height="100%" width="100%" th:src="${contributor.avatar}" th:alt="${contributor.displayName}"> </figure> <p class="nickname" th:text="${contributor.displayName}"></p> <p class="motto spark-input" th:text="${contributor.bio}"></p> <p th:if="${!#strings.isEmpty(theme.config.sidebar.profile_location)}" class="address"> <i class="ri-map-pin-line"></i> <span th:text="${theme.config.sidebar.profile_location}"></span> </p> </div> </nav> <nav class="level" th:if="${!#lists.isEmpty(theme.config.sidebar.custom_stats)}"> <div th:each="item,sindex :${theme.config.sidebar.custom_stats}" class="level-item" th:switch="${item}"> <div th:case="visit" th:with="visit = ${stats.visit}"> <p class="heading" th:text="|访问${visit / 10000000 > 0 ? '(千万)' : (visit / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${visit / 10000 > 0} ? ${visit}" th:text="${visit / 10000000 > 0} ? (${#numbers.formatDecimal(visit / 10000000.0,1,1)}) : (${visit / 10000 > 0} ? (${#numbers.formatDecimal(visit / 10000.0,1,1)}) : ${visit})"></p> </div> <div th:case="upvote" th:with="upvote = ${stats.upvote}"> <p class="heading" th:text="|点赞${upvote / 10000000 > 0 ? '(千万)' : (upvote / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${upvote / 10000 > 0} ? ${upvote}" th:text="${upvote / 10000000 > 0} ? (${#numbers.formatDecimal(upvote / 10000000.0,1,1)}) : (${upvote / 10000 > 0} ? (${#numbers.formatDecimal(upvote / 10000.0,1,1)}) : ${upvote})"></p> </div> <div th:case="comment" th:with="comment = ${stats.comment}"> <p class="heading" th:text="|评论${comment / 10000000 > 0 ? '(千万)' : (comment / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${comment / 10000 > 0} ? ${comment}" th:text="${comment / 10000000 > 0} ? (${#numbers.formatDecimal(comment / 10000000.0,1,1)}) : (${comment / 10000 > 0} ? (${#numbers.formatDecimal(comment / 10000.0,1,1)}) : ${comment})"></p> </div> <div th:case="category" th:with="category = ${stats.category}"> <p class="heading" th:text="|分类${category / 10000000 > 0 ? '(千万)' : (category / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${category / 10000 > 0} ? ${category}" th:text="${category / 10000000 > 0} ? (${#numbers.formatDecimal(category / 10000000.0,1,1)}) : (${category / 10000 > 0} ? (${#numbers.formatDecimal(category / 10000.0,1,1)}) : ${category})"></p> </div> <div th:case="tag" th:with="tagsList = ${tagFinder.listAll()}, tags = ${#lists.size(tagsList)}"> <p class="heading" th:text="|标签${tags / 10000000 > 0 ? '(千万)' : (tags / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${tags / 10000 > 0} ? ${tags}" th:text="${tags / 10000000 > 0} ? (${#numbers.formatDecimal(tags / 10000000.0,1,1)}) : (${tags / 10000 > 0} ? (${#numbers.formatDecimal(tags / 10000.0,1,1)}) : ${tags})"></p> </div> <div th:case="*" th:with="post = ${stats.post}"> <p class="heading" th:text="|文章${post / 10000000 > 0 ? '(千万)' : (post / 10000 > 0 ? '(万)' : '')}|"></p> <p class="value" th:title="${post / 10000 > 0} ? ${post}" th:text="${post / 10000000 > 0} ? (${#numbers.formatDecimal(post / 10000000.0,1,1)}) : (${post / 10000 > 0} ? (${#numbers.formatDecimal(post / 10000.0,1,1)}) : ${post})"></p> </div> </div> </nav> <div th:if="${!#strings.isEmpty(theme.config.sidebar.profile_theme_button)}" class="level" th:with="content = ${#strings.arraySplit(theme.config.sidebar.profile_theme_button,'|')}"> <a class="level-item button is-link is-rounded" th:aria-label="${content[0]}" th:title="${content[0]}" th:href="${content.length>=2?content[1]:''}" target="_blank" rel="nofollow noopener noreferrer" th:text="${content[0]}"></a> </div> <div th:if="${!#lists.isEmpty(theme.config.sidebar.custom_options)}" class="level"> <a th:each="option :${theme.config.sidebar.custom_options}" class="level-item button is-transparent" target="_blank" th:aria-label="${option.name}" th:title="${option.name}" th:href="${option.url}" rel="nofollow noopener noreferrer"> <i th:class="${option.icon}"></i> </a> </div> </div> </div>