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

72 lines
3.5 KiB
HTML

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!-- 推荐文章 -->
<div class="topGroup" th:fragment="top-group" th:with='topGroupPosts = ${postFinder.list(1,6)},
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'
>
<div class="recent-post-item"
th:each="post : ${topGroupPosts}"
th:if="${#strings.equals(theme.config.top.BannerRight.todayRecommendContent.recommendPost, 'latest')}">
<div class="post_cover">
<a th:href="@{${post.status.permalink}}" th:title="${post.spec.title}">
<span class="recent-post-top-text"
th:attr="onclick='pjax.loadUrl(\''+ @{${post.status.permalink}} +'\')'"></span>
<img class="post_bg" loading="lazy"
th:alt="${post.spec.title}"
th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : 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="recent-post-item"
th:each="cuscomPost : ${theme.config.top.BannerRight.todayRecommendContent.recommendPostCustom}"
th:if="${#strings.equals(theme.config.top.BannerRight.todayRecommendContent.recommendPost, 'custom')}">
<div class="post_cover">
<a th:href="@{${cuscomPost.url}}" th:title="${cuscomPost.title}">
<span class="recent-post-top-text"
th:attr="onclick='pjax.loadUrl(\''+ @{${cuscomPost.url}} +'\')'"></span>
<img class="post_bg" loading="lazy"
th:alt="${cuscomPost.title}"
th:src='${#strings.isEmpty(cuscomPost.cover) ? postRandomImg+","+cuscomPost.title : cuscomPost.cover}'
/>
</a>
</div>
<div class="recent-post-info">
<a class="article-title"
th:href="@{${cuscomPost.url}}"
th:text="${cuscomPost.title}"
th:title="${cuscomPost.title}">
</a>
</div>
</div>
<!-- 今日推荐 -->
<div class="todayCard" id="todayCard"
th:if="${theme.config.top.BannerRight.todayRecommend}"
th:attr="onclick='javascript:window.open(\''+ ${theme.config.top.BannerRight.todayRecommendContent.todayRecommendUrl} +'\')'">
<div class="todayCard-info">
<div class="todayCard-tips" th:text="${theme.config.top.BannerRight.todayRecommendContent.todayRecommendxTitle}"></div>
<div class="todayCard-title" th:text="${theme.config.top.BannerRight.todayRecommendContent.todayRecommendTitle}"></div>
</div>
<div class="todayCard-cover"
th:style="'background:url('+ ${theme.config.top.BannerRight.todayRecommendContent.todayRecommendCover} +') no-repeat center/cover'">
</div>
<div class="banner-button-group">
<a class="banner-button" onclick="window.event.cancelBubble=!0;heo.hideTodayCard()">
<i class="iconfont icon-plus-circle"></i>
<span class="banner-button-text">更多推荐</span>
</a>
</div>
</div>
</div>
</html>