halo-theme-hao/templates/modules/widgets/top-group.html

43 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- 这里应该改为 6 篇置顶文章 -->
<div class="topGroup" th:fragment="top-group" th:with="posts = ${postFinder.list(1,6)}">
<div class="recent-post-item" th:each="post : ${posts}">
<div class="post_cover">
<a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<span class="recent-post-top-text"></span>
<img class="post_bg" loading="lazy"
th:alt="${post.spec.title}"
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.layout.post_random_img : post.spec.cover}">
</a>
</div>
<div class="recent-post-info">
<a class="article-title"
th:href="@{${post.status.permalink}}"
th:text="${post.spec.title}"
th:title="${post.spec.title}">
</a>
</div>
</div>
<!-- 今日推荐 -->
<div class="todayCard" id="todayCard"
th:if="${theme.config.top.todayRecommend}"
th:onclick="'window.open('+ ${theme.config.top.todayRecommendUrl} +')'">
<div class="todayCard-info">
<div class="todayCard-tips">今日推荐</div>
<div class="todayCard-title" th:text="${theme.config.top.todayRecommendTitle}"></div>
</div>
<div class="todayCard-cover"
th:style="'background:url('+ ${theme.config.top.todayRecommendCover} +') no-repeat center/cover'">
</div>
<div class="banner-button-group">
<a class="banner-button" onclick="window.event.cancelBubble=!0;heo.hideTodayCard()">
<i class="fas fa-circle-plus"></i>
<span class="banner-button-text">更多推荐</span>
</a>
</div>
</div>
</div>
</html>