Skip to content

Commit

Permalink
Fix: 文章默认显示该分类下最新的三篇文章
Browse files Browse the repository at this point in the history
  • Loading branch information
Waite0603 authored and AirboZH committed Sep 15, 2023
1 parent 128e0bb commit 097263f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions templates/modules/post/relatedPosts.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
<h3 class="mb-4">Further Reading</h3>
<div th:if="${not #lists.isEmpty(post.categories)}">
<nav class="row row-cols-1 row-cols-md-2 row-cols-xl-3 g-4 mb-4"
th:each="recommendPosts : ${post.categories[0]}"
th:with="recommendPosts = ${postFinder.listByCategory(1, 10, recommendPosts.metadata.name)}">
th:with="recommendPosts = ${postFinder.listByCategory(1, 3, post.categories[0].metadata.name)}">
<article class="col"
th:each="recommendPost : ${recommendPosts.items}"
th:if="${post.metadata.name != recommendPost.metadata.name}">
th:each="recommendPost : ${recommendPosts.items}">
<a th:href="@{${recommendPost.status.permalink}}" class="post-preview card h-100">
<div class="card-body">
<time class="small" style="color: #A4A4A4;"
Expand Down

0 comments on commit 097263f

Please sign in to comment.