<nav class="blog-pagination" aria-label="Pagination">
{% if paginate.has_prev %}
<a class="btn btn-outline-primary rounded-pill" href="{{ url_for('index.index', page=paginate.prev_num) }}">上一页</a>
{% else %}
<a class="btn btn-outline-primary rounded-pill" href="#">上一页</a>
{% endif %}
<!-- 显示所有存在的页码 -->
{% for num in range(1, paginate.pages + 1) %}
<a class="btn btn-outline-primary rounded-pill {% if num == paginate.page %}active{% endif %}" href="#">{{ num }}</a>
{% endfor %}
{% if paginate.has_next %}
<a class="btn btn-outline-secondary rounded-pill" href="{{ url_for('index.index', page=paginate.next_num) }}">下一页</a>
{% else %}
<a class="btn btn-outline-secondary rounded-pill disabled">下一页</a>
{% endif %}
</nav>
发表回复