2023-03-23 18:25:48 +08:00

17 lines
926 B
HTML

<div xmlns:th="https://www.thymeleaf.org"
th:fragment="widget (hide)"
th:class="'card widget recent-posts ' + ${hide}"
th:with="num = ${#strings.isEmpty(theme.config.sidebar.recent_posts_num)? 5 : #numbers.sequence(theme.config.sidebar.recent_posts_num,theme.config.sidebar.recent_posts_num)[0]}, posts = ${postFinder.list(1,num)}, isEmpty = ${#lists.isEmpty(posts)}">
<div class="card-title">
<i class="fa fa-history card-title-label"></i><span>最新文章</span>
</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="@{${ps.status.permalink}}" th:title="${ps.spec.title}" th:text="${ps.spec.title}"></a>
<i class="fa fa-link"></i>
</li>
</ul>
</div>
</div>