/usr/share/httpd/grav/user/plugins/pagination/templates/partials/pagination.html.twig (1)
{# -------------------------------------------------------------------------- #}
{# pagination.html.twig
{# ====================
{#
{# Project Root Server
{# Scope Native
{# Copyright (C) 2025 by RaySoft, Zurich, Switzerland
{# License GNU General Public License (GPL) 2.0
{# https://www.gnu.org/licenses/gpl2.txt
{#
{# -------------------------------------------------------------------------- #}
{% set pagination = pagination|default(page.collection.params.pagination) %}
{% set blog_url = page.header.blog_url %}
{% if pagination|length > 1 %}
<ul class="pagination">
{% if pagination.hasPrev %}
{% set url = (blog_url ~ pagination.params ~ pagination.prevUrl)|replace({'//':'/'}) %}
<li><a rel="prev" href="{{ url }}">«</a></li>
{% else %}
<li><span>«</span></li>
{% endif %}
{% for paginate in pagination %}
{% if paginate.isCurrent %}
<li><span class="active">{{ paginate.number }}</span></li>
{% elseif paginate.isInDelta %}
{% set url = (blog_url ~ pagination.params ~ paginate.url)|replace({'//':'/'}) %}
<li><a href="{{ url }}">{{ paginate.number }}</a></li>
{% elseif paginate.isDeltaBorder %}
<li class="gap"><span>…</span></li>
{% endif %}
{% endfor %}
{% if pagination.hasNext %}
{% set url = (blog_url ~ pagination.params ~ pagination.nextUrl)|replace({'//':'/'}) %}
<li><a rel="next" href="{{ url }}">»</a></li>
{% else %}
<li><span>»</span></li>
{% endif %}
</ul>
{% endif %}
Usage
See Grav Howto (1)