Files
theme-earth/templates/category.html
2022-10-24 11:40:53 +08:00

46 lines
2.2 KiB
HTML

<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="modules/layout :: html(header = null, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)"
>
<th:block th:fragment="content">
<th:block th:replace="modules/category-filter" />
<div
id="post-list"
th:if="${posts.total gt 0}"
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
class="mt-6 grid grid-cols-1 gap-6"
th:classappend="${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} + ' ' + ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}"
>
<th:block th:each="post : ${postItems}">
<th:block
th:replace="modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})"
/>
</th:block>
</div>
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
<span class="text-sm font-light text-gray-600">此分类下没有文章</span>
</div>
<div class="mt-6 flex items-center justify-between" th:if="${posts.hasPrevious() || posts.hasNext()}">
<a
th:href="@{${posts.prevUrl}}"
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none"
>
<span data-icon="tabler:arrow-left" class="iconify text-lg transition-all group-hover:-translate-x-1"></span>
<span>上一页</span>
</a>
<span class="text-sm text-gray-900" th:text="${posts.page} +' / '+ ${posts.total}"></span>
<a
th:href="@{${posts.nextUrl}}"
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none"
>
<span>下一页</span>
<span data-icon="tabler:arrow-right" class="iconify text-lg transition-all group-hover:translate-x-1"></span>
</a>
</div>
</th:block>
</html>