2023-03-25 12:46:08 +08:00
|
|
|
<th:block xmlns:th="https://www.thymeleaf.org"
|
2023-03-27 12:10:21 +08:00
|
|
|
th:fragment="articleList (posts)">
|
2023-03-23 18:25:48 +08:00
|
|
|
<th:block th:each="post : ${posts}"
|
2024-09-11 06:53:22 +08:00
|
|
|
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : thumbnail.gen(post.spec.cover, 'l')},
|
2024-09-07 07:51:02 +08:00
|
|
|
thumbnail_mode = ${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))? 'grid' : (!#strings.isEmpty(post.metadata.annotations.get('thumbnail_mode')) && post.metadata.annotations.get('thumbnail_mode') != 'none')? post.metadata.annotations.get('thumbnail_mode') : post.spec.pinned ? theme.config.post.top_thumbnail_mode : theme.config.post.thumbnail_mode}">
|
2023-03-24 20:25:04 +08:00
|
|
|
<div th:if="${!#strings.isEmpty(thumbnail) && thumbnail_mode == 'back'}" class="card widget card-cover">
|
|
|
|
<a th:href="${post.status.permalink}">
|
|
|
|
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'"></div>
|
|
|
|
<div class="details">
|
|
|
|
<h2 class="title"><span class="top" th:if="${post.spec.pinned}">置顶</span>[[${post.spec.title}]]</h2>
|
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-eye-line"></i>[[${post.stats.visit}]]</li>
|
|
|
|
<li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="ri-question-answer-line"></i>[[${post.stats.comment}]]
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
2023-03-24 20:25:04 +08:00
|
|
|
<li
|
|
|
|
th:with="heat= ${24+post.stats.visit*0.1+post.stats.upvote*2+post.stats.comment*3}, heatColor= '#'+${(heat < 37)? 'ffa87e' : (heat < 120)? 'fb734a' : 'e0081c'}"
|
2023-08-10 14:14:19 +08:00
|
|
|
th:style="'color: ' + ${heatColor}">[[${#numbers.formatDecimal(heat,0,1)}]]℃
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<div th:if="${!#lists.isEmpty(post.categories)}" class="category">
|
|
|
|
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
th:if="${!#strings.isEmpty(thumbnail) && (thumbnail_mode == 'small' || (thumbnail_mode == 'small-alter' && postStat.index % 2 == 0))}"
|
|
|
|
class="card widget card-small">
|
|
|
|
<a th:href="${post.status.permalink}">
|
|
|
|
<div class="small-image" th:style="'background-image: url(' + ${thumbnail} + ')'"></div>
|
|
|
|
</a>
|
|
|
|
<div class="card-content main">
|
|
|
|
<h2 class="title">
|
|
|
|
<span class="top" th:if="${post.spec.pinned}">置顶</span><a
|
|
|
|
th:href="${post.status.permalink}" th:text="${post.spec.title}"></a>
|
|
|
|
</h2>
|
2023-07-12 10:32:28 +08:00
|
|
|
<div class="main-content" th:text="${post.status.excerpt}"></div>
|
2023-03-24 20:25:04 +08:00
|
|
|
<hr/>
|
|
|
|
<div class="meta">
|
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-eye-line"></i>[[${post.stats.visit}]]</li>
|
|
|
|
<li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="ri-question-answer-line"></i>[[${post.stats.comment}]]
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
2023-03-24 20:25:04 +08:00
|
|
|
<li
|
|
|
|
th:with="heat= ${24+post.stats.visit*0.1+post.stats.upvote*2+post.stats.comment*3}, heatColor= '#'+${(heat < 37)? 'ffa87e' : (heat < 120)? 'fb734a' : 'e0081c'}"
|
2023-08-10 14:14:19 +08:00
|
|
|
th:style="'color: ' + ${heatColor}">[[${#numbers.formatDecimal(heat,0,1)}]]℃
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div th:if="${!#lists.isEmpty(post.categories)}" class="level-item is-hidden-mobile">
|
|
|
|
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
th:if="${!#strings.isEmpty(thumbnail) && (thumbnail_mode == 'small-right' || (thumbnail_mode == 'small-alter' && postStat.index % 2 == 1))}"
|
|
|
|
class="card widget card-small">
|
|
|
|
<div class="card-content main">
|
|
|
|
<h2 class="title">
|
|
|
|
<span class="top" th:if="${post.spec.pinned}">置顶</span><a
|
|
|
|
th:href="${post.status.permalink}" th:text="${post.spec.title}"></a>
|
|
|
|
</h2>
|
2023-07-12 10:32:28 +08:00
|
|
|
<div class="main-content" th:text="${post.status.excerpt}"></div>
|
2023-03-24 20:25:04 +08:00
|
|
|
<hr/>
|
|
|
|
<div class="meta">
|
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-eye-line"></i>[[${post.stats.visit}]]</li>
|
|
|
|
<li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="ri-question-answer-line"></i>[[${post.stats.comment}]]
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
2023-03-24 20:25:04 +08:00
|
|
|
<li
|
|
|
|
th:with="heat= ${24+post.stats.visit*0.1+post.stats.upvote*2+post.stats.comment*3}, heatColor= '#'+${(heat < 37)? 'ffa87e' : (heat < 120)? 'fb734a' : 'e0081c'}"
|
2023-08-10 14:14:19 +08:00
|
|
|
th:style="'color: ' + ${heatColor}">[[${#numbers.formatDecimal(heat,0,1)}]]℃
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div th:if="${!#lists.isEmpty(post.categories)}" class="level-item is-hidden-mobile">
|
|
|
|
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<a th:href="${post.status.permalink}">
|
|
|
|
<div class="small-image" th:style="'background-image: url(' + ${thumbnail} + ')'"></div>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
2023-03-27 12:10:21 +08:00
|
|
|
<a th:if="${post.spec.pinned && thumbnail_mode == 'fold'}" class="card widget card-fold"
|
|
|
|
th:href="${post.status.permalink}">
|
2023-03-24 20:25:04 +08:00
|
|
|
<h2 class="title"><span class="top">置顶</span>
|
|
|
|
<p th:text="${post.spec.title}"></p></h2>
|
|
|
|
<p th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd')}"></p>
|
|
|
|
</a>
|
|
|
|
|
2024-07-04 20:43:02 +08:00
|
|
|
<div th:if="${(#strings.isEmpty(thumbnail) && thumbnail_mode != 'fold') || thumbnail_mode == 'default'}"
|
2023-03-27 12:10:21 +08:00
|
|
|
class="card widget">
|
2023-03-24 20:25:04 +08:00
|
|
|
<a th:if="${!#strings.isEmpty(thumbnail)}" class="thumbnail" th:href="${post.status.permalink}">
|
|
|
|
<div class="thumbnail-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
<div class="card-content main">
|
|
|
|
<h2 class="title">
|
|
|
|
<span class="top" th:if="${post.spec.pinned}">置顶</span><a
|
|
|
|
th:href="${post.status.permalink}" th:text="${post.spec.title}"></a>
|
|
|
|
</h2>
|
|
|
|
<div class="meta">
|
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-eye-line"></i>[[${post.stats.visit}]]</li>
|
|
|
|
<li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="ri-question-answer-line"></i>[[${post.stats.comment}]]
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li class="is-hidden-mobile"><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
2023-03-24 20:25:04 +08:00
|
|
|
<li
|
|
|
|
th:with="heat= ${24+post.stats.visit*0.1+post.stats.upvote*2+post.stats.comment*3}, heatColor= '#'+${(heat < 37)? 'ffa87e' : (heat < 120)? 'fb734a' : 'e0081c'}"
|
2023-08-10 14:14:19 +08:00
|
|
|
th:style="'color: ' + ${heatColor}">[[${#numbers.formatDecimal(heat,0,1)}]]℃
|
2023-03-24 20:25:04 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<div th:if="${!#lists.isEmpty(post.categories)}" class="level-item">
|
|
|
|
<a th:each="cy : ${post.categories}" th:href="${cy.status.permalink}" th:text="${cy.spec.displayName}"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<hr/>
|
2023-07-12 10:32:28 +08:00
|
|
|
<div class="main-content" th:text="${post.status.excerpt}"></div>
|
2023-03-24 20:25:04 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-23 18:25:48 +08:00
|
|
|
</th:block>
|
2023-03-27 12:10:21 +08:00
|
|
|
<div th:if="${theme.config.post.top_thumbnail_mode == 'grid' || theme.config.post.thumbnail_mode == 'grid'}"
|
|
|
|
class="column-main-grid">
|
|
|
|
<th:block th:each="post : ${posts}"
|
2023-12-29 17:20:34 +08:00
|
|
|
th:with="thumbnail = ${#strings.isEmpty(post.spec.cover) ? #strings.isEmpty(theme.config.post.default_thumbnail) ? '' : theme.config.post.default_thumbnail + (#strings.contains(theme.config.post.default_thumbnail, '?') ? '&' : '?') + 'id=' + post.metadata.name : post.spec.cover}">
|
2023-03-27 12:10:21 +08:00
|
|
|
<div
|
|
|
|
th:if="${(theme.config.post.top_thumbnail_mode == 'grid' || (!post.spec.pinned && theme.config.post.thumbnail_mode == 'grid'))}"
|
|
|
|
class="card widget">
|
|
|
|
<a class="thumbnail" th:href="${post.status.permalink}">
|
|
|
|
<div class="thumbnail-image" th:style="'background-image: url(' + ${thumbnail} + ')'"></div>
|
|
|
|
</a>
|
|
|
|
<ul class="breadcrumb">
|
|
|
|
<li th:text="${#dates.format(post.spec.publishTime, 'yyyy-MM-dd HH:mm')}"></li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-eye-line"></i>[[${post.stats.visit}]]</li>
|
|
|
|
<li th:if="${post.spec.allowComment}" class="is-hidden-mobile"><i class="ri-question-answer-line"></i>[[${post.stats.comment}]]
|
2023-03-27 12:10:21 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li class="is-hidden-mobile"><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
2023-03-27 12:10:21 +08:00
|
|
|
<li
|
|
|
|
th:with="heat= ${24+post.stats.visit*0.1+post.stats.upvote*2+post.stats.comment*3}, heatColor= '#'+${(heat < 37)? 'ffa87e' : (heat < 120)? 'fb734a' : 'e0081c'}"
|
2023-08-10 14:14:19 +08:00
|
|
|
th:style="'color: ' + ${heatColor}">[[${#numbers.formatDecimal(heat,0,1)}]]℃
|
2023-03-27 12:10:21 +08:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<h2 class="title">
|
|
|
|
<span class="top" th:if="${post.spec.pinned}">置顶</span>
|
|
|
|
<a
|
|
|
|
th:href="${post.status.permalink}" th:text="${post.spec.title}"></a>
|
|
|
|
</h2>
|
|
|
|
</div>
|
|
|
|
</th:block>
|
|
|
|
</div>
|
2024-07-04 20:43:02 +08:00
|
|
|
</th:block>
|