文件
halo-theme/templates/post.html
T
admin 4a06992715
Theme CD / Package Theme (release) Successful in 30s
Theme CD / Release (release) Successful in 8s
refactor(theme): enhance link resolution logic for archives, categories, and tags
2026-06-16 18:12:06 +08:00

82 行
3.9 KiB
HTML

此文件含有模棱两可的 Unicode 字符
此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |${post.spec.title} - ${site.title}|, pageType = 'post', terminalUserName = ${post != null and post.owner != null and !#strings.isEmpty(post.owner.name) ? post.owner.name : 'admin'}, content = ~{::content})}"
>
<th:block th:fragment="content">
<article class="devcm-editor-window devcm-article" x-data="postLineNum" x-init="init()">
<div class="devcm-editor-tabs">
<div
class="devcm-editor-tab devcm-editor-tab--active"
th:with="postTabBaseName=${!#strings.isEmpty(post.spec.slug) ? post.spec.slug : post.metadata.name},
postTabName=${#strings.endsWith(postTabBaseName, '.md') ? postTabBaseName : postTabBaseName + '.md'},
archiveActivityItem=${theme.config.activity.activity_items != null and !#lists.isEmpty(theme.config.activity.activity_items) ? theme.config.activity.activity_items.^[type == 'archive' or key == 'archive'] : null},
postCloseHref=${!#strings.isEmpty(site.routes.archivesUri) ? site.routes.archivesUri : (archiveActivityItem != null and !#strings.isEmpty(archiveActivityItem.url) ? archiveActivityItem.url : (archiveActivityItem != null and !#strings.isEmpty(archiveActivityItem.href) ? archiveActivityItem.href : '/archives'))}"
>
<span th:text="${postTabName}">post</span>
<a
class="devcm-editor-tab__close"
href="#"
th:href="${postCloseHref}"
th:aria-label="#{devcm.action.closePostTab}"
th:title="#{devcm.action.closePostTab}"
>×</a
>
</div>
</div>
<div class="post-body devcm-article-body">
<div class="post-line-gutter"></div>
<div class="post-content devcm-article-content">
<div>
<h1 class="devcm-article-title" th:text="'< ' + ${post.spec.title} + ' >'">Post Title</h1>
<div class="devcm-article-meta">
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">publishTime</span>
<span th:text="${post.owner.displayName}">Author</span>
<a
th:each="tag : ${post.tags}"
th:href="${tag.status.permalink}"
th:title="${tag.spec.displayName}"
th:text="'#' + ${tag.spec.displayName}"
>
#Tag
</a>
</div>
<div th:utext="${post.content.content}">Post Content</div>
</div>
</div>
</div>
</article>
<section class="comment-wrap devcm-comments" x-data="themeComment()" x-init="init()" th:if="${haloCommentEnabled}">
<div class="devcm-comment-titlebar">
<span class="devcm-window-dot"></span>
<span class="devcm-window-dot"></span>
<span class="devcm-window-dot"></span>
<strong th:text="#{devcm.comments.file}">comments.log</strong>
</div>
<div class="devcm-comment-body">
<h2 th:text="#{devcm.comments.title}">## Comments</h2>
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}" />
</div>
</section>
<nav class="pagination devcm-prev-next" th:with="postCursor=${postFinder.cursor(post.metadata?.name)}">
<div class="pagination__buttons">
<span th:if="${postCursor.hasPrevious()}" class="button previous">
<a th:href="${postCursor.previous?.status?.permalink}">
<span class="button__icon"><&nbsp;</span>
<span class="button__text" th:text="${postCursor.previous?.spec?.title}">Previous</span>
</a>
</span>
<span th:if="${postCursor.hasNext()}" class="button next">
<a th:href="${postCursor.next?.status?.permalink}">
<span class="button__text" th:text="${postCursor.next?.spec?.title}">Next</span>
<span class="button__icon">&nbsp;></span>
</a>
</span>
</div>
</nav>
</th:block>
</html>