refactor: extract pagination fragments

This commit is contained in:
Erzbir
2026-08-07 14:48:48 +08:00
parent bca8725ac8
commit 8d8d561374
9 changed files with 90 additions and 116 deletions
+3 -18
View File
@@ -25,24 +25,9 @@
<button id="toc-toggle" class="toc-toggle" th:attr="aria-label=#{toc.hide}"></button>
<div id="toc-content" class="toc-content"></div>
</nav>
<nav class="pagination">
<div class="pagination-title">
<span class="pagination-title-h" th:text="#{page.post.pagination}">READ OTHER POSTS</span>
<hr/>
</div>
<div class="pagination-buttons" th:with="postCursor=${postFinder.cursor(post.metadata?.name)}">
<span th:if="${postCursor.hasPrevious()}">
<a data-pjax th:href="@{${postCursor.previous?.status?.permalink}}" class="button prev inline">
<span class="button-text" th:text="|< ${postCursor.previous?.spec?.title}|">prevPost</span>
</a>
</span>
<span th:if="${postCursor.hasNext()}">
<a data-pjax th:href="@{${postCursor.next?.status?.permalink}}" class="button next inline">
<span class="button-text" th:text="|${postCursor.next?.spec?.title} >|">nextPost</span>
</a>
</span>
</div>
</nav>
<th:block th:replace="~{modules/pagination :: post(
cursor=${postFinder.cursor(post.metadata?.name)}
)}"/>
<th:block
th:replace="~{modules/comment :: comment(group = 'content.halo.run', kind = 'Post', name = ${post.metadata.name})}"
th:if="${haloCommentEnabled}"/>