fix: 修复推荐文章和文章列表的图片重复问题
This commit is contained in:
parent
ffc84372b0
commit
1533b8218d
|
@ -2,8 +2,8 @@
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<th:block th:fragment="post-list"
|
<th:block th:fragment="post-list"
|
||||||
th:with='postItems=${posts.items},postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'>
|
th:with='postItems=${posts.items},
|
||||||
|
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'>
|
||||||
|
|
||||||
<!-- card,需要添加在没有图片时使用随机图片 -->
|
<!-- card,需要添加在没有图片时使用随机图片 -->
|
||||||
<div class="recent-post-item"
|
<div class="recent-post-item"
|
||||||
|
@ -17,7 +17,8 @@
|
||||||
<a th:attr="title=${post.spec.title}" th:href="@{${post.status.permalink}}">
|
<a th:attr="title=${post.spec.title}" th:href="@{${post.status.permalink}}">
|
||||||
<img class="post_bg entered loaded" loading="lazy"
|
<img class="post_bg entered loaded" loading="lazy"
|
||||||
th:alt="${post.status.excerpt}"
|
th:alt="${post.status.excerpt}"
|
||||||
th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+iStat.index : post.spec.cover}'> </a>
|
th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : post.spec.cover}'>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<!-- 类别非空时 -->
|
<!-- 类别非空时 -->
|
||||||
<th:block th:if="${not #lists.isEmpty(post.categories)}">
|
<th:block th:if="${not #lists.isEmpty(post.categories)}">
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
<html lang="en" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
|
||||||
<!-- 推荐文章 -->
|
<!-- 推荐文章 -->
|
||||||
<div class="topGroup" th:fragment="top-group" th:with="topGroupPosts = ${postFinder.list(1,theme.config.post.recommendQuantity)}">
|
<div class="topGroup" th:fragment="top-group" th:with='topGroupPosts = ${postFinder.list(1,theme.config.post.recommendQuantity)},
|
||||||
|
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'
|
||||||
|
>
|
||||||
<div class="recent-post-item"
|
<div class="recent-post-item"
|
||||||
th:each="post : ${topGroupPosts}"
|
th:each="post : ${topGroupPosts}"
|
||||||
th:if="${#strings.equals(theme.config.top.recommendPost, 'latest')}">
|
th:if="${#strings.equals(theme.config.top.recommendPost, 'latest')}">
|
||||||
|
@ -12,7 +14,8 @@
|
||||||
<span class="recent-post-top-text">荐</span>
|
<span class="recent-post-top-text">荐</span>
|
||||||
<img class="post_bg" loading="lazy"
|
<img class="post_bg" loading="lazy"
|
||||||
th:alt="${post.spec.title}"
|
th:alt="${post.spec.title}"
|
||||||
th:src="${#strings.isEmpty(post.spec.cover) ? theme.config.layout.postRandomImg : post.spec.cover}">
|
th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : post.spec.cover}'
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="recent-post-info">
|
<div class="recent-post-info">
|
||||||
|
@ -32,7 +35,8 @@
|
||||||
<span class="recent-post-top-text">荐</span>
|
<span class="recent-post-top-text">荐</span>
|
||||||
<img class="post_bg" loading="lazy"
|
<img class="post_bg" loading="lazy"
|
||||||
th:alt="${cuscomPost.title}"
|
th:alt="${cuscomPost.title}"
|
||||||
th:src="${cuscomPost.cover}">
|
th:src='${#strings.isEmpty(cuscomPost.cover) ? postRandomImg+","+cuscomPost.title : cuscomPost.cover}'
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="recent-post-info">
|
<div class="recent-post-info">
|
||||||
|
|
Loading…
Reference in New Issue