2023-03-25 02:04:42 +08:00
|
|
|
<th:block xmlns:th="https://www.thymeleaf.org"
|
|
|
|
th:fragment="article (post, type)"
|
2023-12-29 17:04:21 +08:00
|
|
|
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()},
|
2024-09-15 19:24:24 +08:00
|
|
|
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, 'xl')}">
|
2023-03-24 20:25:04 +08:00
|
|
|
|
2023-12-29 17:04:21 +08:00
|
|
|
<div th:if="${!#strings.isEmpty(thumbnail)}" class="card widget">
|
|
|
|
<div class="cover-image" th:style="'background-image: url(' + ${thumbnail} + ')'">
|
2023-03-25 02:04:42 +08:00
|
|
|
<div th:if="${type == 'Post' && !#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 class="details">
|
|
|
|
<h1 class="title" th:text="${post.spec.title}"></h1>
|
|
|
|
<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-25 02:04:42 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
|
|
|
<li><i class="ri-quill-pen-line"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
|
2023-03-25 02:04:42 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
2023-03-24 20:25:04 +08:00
|
|
|
</div>
|
|
|
|
|
2023-03-25 02:04:42 +08:00
|
|
|
<div th:if="${!#strings.isEmpty(theme.config.post.invalid_tips_day) && updateInterval > T(java.lang.Long).parseLong(theme.config.post.invalid_tips_day)}"
|
2023-09-12 10:44:43 +08:00
|
|
|
class="card tips brightness"><i class="ri-close-line click-close" data-close=".tips"></i>本文最后更新于
|
2023-03-25 02:04:42 +08:00
|
|
|
[[${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}]],距今已有 [[${updateInterval}]]
|
|
|
|
天,若文章内容或图片链接失效,请留言反馈。
|
|
|
|
</div>
|
2023-03-24 20:25:04 +08:00
|
|
|
|
2023-05-05 13:55:17 +08:00
|
|
|
<div th:if="${!#strings.isEmpty(post.metadata.annotations.get('tips'))}" class="card tips brightness"><i
|
2023-09-12 10:44:43 +08:00
|
|
|
class="ri-close-line click-close" data-close=".tips"></i>[[${post.metadata.annotations.tips}]]
|
2023-03-25 02:04:42 +08:00
|
|
|
</div>
|
2023-03-24 20:25:04 +08:00
|
|
|
|
2023-03-25 02:04:42 +08:00
|
|
|
<div class="card">
|
|
|
|
<div class="card-content main">
|
2023-12-29 17:04:21 +08:00
|
|
|
<th:block th:if="${#strings.isEmpty(thumbnail)}">
|
2023-03-25 02:04:42 +08:00
|
|
|
<h1 class="title" th:text="${post.spec.title}"></h1>
|
|
|
|
<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-25 02:04:42 +08:00
|
|
|
</li>
|
2023-09-12 10:44:43 +08:00
|
|
|
<li><i class="ri-thumb-up-line"></i>[[${post.stats.upvote}]]</li>
|
|
|
|
<li><i class="ri-quill-pen-line"></i>[[${#strings.length(#strings.trim(post.content.content))}]]</li>
|
2023-03-25 02:04:42 +08:00
|
|
|
</ul>
|
|
|
|
<div th:if="${type == 'Post' && !#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/>
|
|
|
|
</th:block>
|
2023-03-24 20:25:04 +08:00
|
|
|
|
2023-03-25 02:04:42 +08:00
|
|
|
<div th:data-id="${post.metadata.name}" th:data-target="${type}" class="main-content article"
|
|
|
|
th:utext="${post.content.content}">
|
|
|
|
</div>
|
2023-03-21 10:49:35 +08:00
|
|
|
|
2023-03-25 12:46:08 +08:00
|
|
|
<th:block th:replace="~{main/admire}"/>
|
2023-03-21 10:49:35 +08:00
|
|
|
|
2023-03-25 02:04:42 +08:00
|
|
|
<div th:if="${type == 'Post' && !#lists.isEmpty(post.tags)}" class="article-operation">
|
|
|
|
<div class="level-item">
|
|
|
|
<a th:each=" tag : ${post.tags}" th:href="${tag.status.permalink}"
|
|
|
|
th:text="${tag.spec.displayName}"></a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<th:bolck th:if="${enableCopyright || enableShare}">
|
|
|
|
<hr/>
|
|
|
|
<th:block th:if="${enableCopyright}">
|
2023-03-29 16:34:55 +08:00
|
|
|
<th:block th:replace="~{main/copyright}"/>
|
2023-03-25 02:04:42 +08:00
|
|
|
</th:block>
|
|
|
|
<div th:if="${enableShare}" class="dshare"></div>
|
|
|
|
</th:bolck>
|
2023-03-21 10:49:35 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2023-03-25 02:04:42 +08:00
|
|
|
<th:block th:if="${type == 'Post'}" th:with="postCursor = ${postFinder.cursor(post.metadata.name)}">
|
|
|
|
<div th:if="${postCursor.hasPrevious() || postCursor.hasNext()}" class="card">
|
|
|
|
<div class="level post-navigation card-content">
|
|
|
|
<a th:if="${postCursor.hasPrevious()}" class="level-item"
|
|
|
|
th:href="@{${postCursor.previous.status.permalink}}">
|
2023-09-12 10:44:43 +08:00
|
|
|
<i class="ri-arrow-left-s-line"></i><span th:text="${postCursor.previous.spec.title}"></span>
|
2023-03-25 02:04:42 +08:00
|
|
|
</a>
|
|
|
|
<a th:if="${postCursor.hasNext()}" class="level-item" th:href="@{${postCursor.next.status.permalink}}">
|
2023-09-12 10:44:43 +08:00
|
|
|
<span th:text="${postCursor.next.spec.title}"></span><i class="ri-arrow-right-s-line"></i>
|
2023-03-25 02:04:42 +08:00
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</th:block>
|
2023-03-24 20:25:04 +08:00
|
|
|
|
2024-03-09 10:57:53 +08:00
|
|
|
<div class="card card-content comment-wrapper-z-index" id="comment-wrapper" th:if="${enableComment}">
|
2023-03-25 02:04:42 +08:00
|
|
|
<h3 class="comment-title">评论</h3>
|
2024-09-15 20:01:45 +08:00
|
|
|
<th:block th:unless="${theme.config.enhance.enable_comment_type}">
|
2024-05-07 13:01:30 +08:00
|
|
|
<comment-widget
|
|
|
|
group="content.halo.run"
|
|
|
|
th:kind="${type}"
|
|
|
|
version="v1alpha1"
|
|
|
|
th:name="${post.metadata.name}"
|
|
|
|
with-replies="false"
|
|
|
|
></comment-widget>
|
|
|
|
</th:block>
|
2024-09-15 20:01:45 +08:00
|
|
|
<th:block th:if="${theme.config.enhance.enable_comment_type}">
|
2024-05-07 13:01:30 +08:00
|
|
|
<halo:comment
|
|
|
|
group="content.halo.run"
|
|
|
|
th:kind="${type}"
|
|
|
|
th:attr="name=${post.metadata.name}"
|
|
|
|
/>
|
|
|
|
</th:block>
|
2023-03-25 02:04:42 +08:00
|
|
|
</div>
|
|
|
|
</th:block>
|