96 lines
5.3 KiB
HTML
Raw Normal View History

2023-03-25 02:04:42 +08:00
<th:block xmlns:th="https://www.thymeleaf.org"
th:fragment="article (post, type)"
th:with="updateInterval = ${T(java.lang.Math).floor((#dates.createNow().getTime()/1000.0 - post.status.lastModifyTime.getEpochSecond())/86400.0).intValue()}">
2023-03-24 20:25:04 +08:00
2023-03-25 02:04:42 +08:00
<div th:if="${!#strings.isEmpty(post.spec.cover)}" class="card widget">
<div class="cover-image" th:style="'background-image: url(' + ${post.spec.cover} + ')'">
<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>&nbsp;
</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
<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">
<th:block th:if="${#strings.isEmpty(post.spec.cover)}">
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>&nbsp;
</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>&nbsp;
</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
<div class="card card-content" id="comment-wrapper" th:if="${enableComment}">
2023-03-25 02:04:42 +08:00
<h3 class="comment-title">评论</h3>
<div class="comment-section" th:data-id="${post.metadata.name}" th:data-target="${type}"></div>
2023-03-25 02:04:42 +08:00
</div>
</th:block>