j m 440ed26527 新增自定义侧边栏模块
移除原有公告内容输入框,改为侧边栏组中输入内容
2024-04-28 21:06:18 +08:00

18 lines
1.1 KiB
HTML

<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (sidebar)"
th:class="'card widget recent-posts ' + ${sidebar.hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_posts_num)? 5 : T(java.lang.Integer).parseInt(theme.config.sidebar.recent_posts_num)}, posts = ${postFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(posts)}">
<div class="card-title">
<i th:class="${#strings.defaultString(sidebar.icon, 'ri-history-line') + ' card-title-label'}"></i><span th:text="${#strings.defaultString(sidebar.title, '最新文章')}"></span>
<a th:if="${theme.config.sidebar.recent_posts_more}" class="card-more" th:href="@{/archives}">更多<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">
<ul class="list">
<li class="item" th:each="post : ${posts}">
<a class="link" th:href="@{${post.status.permalink}}" th:title="${post.spec.title}" th:text="${post.spec.title}"></a>
<i class="ri-link"></i>
</li>
</ul>
</div>
</div>