<!DOCTYPE html>
<html lang="en" xmlns:th="https://www.thymeleaf.org">
<th:block th:fragment="pagination">
    <th:block th:if="${pageType == 'index'}" th:fragment="index">

        <th:block
             th:if="${posts.hasPrevious() || posts.hasNext()}"
             th:with="totalPages = ${posts.totalPages}, pageIndex = ${posts.page}">
            <!--        页面总数小于等于7-->
            <nav class=pagination th:if="${(totalPages le 7) && (totalPages gt 0)}">
                <span class="page-li