1
0
Fork 0
forked from github/pelican
pelican-theme/templates/pagination.html

60 lines
2.8 KiB
HTML
Raw Normal View History

2025-05-22 12:14:30 +02:00
{% if DEFAULT_PAGINATION %}
{% set first_page = articles_paginator.page(1) %}
{% set last_page = articles_paginator.page(articles_paginator.num_pages) %}
2024-12-19 09:56:25 +01:00
<nav class="flex justify-center items-center">
2025-05-22 12:14:30 +02:00
{% if articles_page.has_previous() %}
<ul class="list-none inline-grid grid-cols-[max-content_max-content_max-content_max-content_max-content_max-content] border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay m-4 p-4">
2024-12-19 09:56:25 +01:00
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-12">
<a
class="block no-underline hover:no-underline"
title="Go to the previous page"
href="{{ SITEURL }}/{{ articles_previous_page.url }}"
><tt>&laquo;</tt></a>
</li>
</span>
2025-05-22 12:14:30 +02:00
{% else %}
<!--If we are on the first page, there's no previous links, so reduce grid sizing-->
<ul class="list-none inline-grid grid-cols-[max-content_max-content_max-content_max-content_max-content] border-t-2 border-rp-dawn-overlay dark:border-rp-moon-overlay m-4 p-4">
{% endif %}
<!-- Current page -->
2024-12-19 09:56:25 +01:00
<span class="p-1">
2025-05-22 12:14:30 +02:00
<li class="text-center bg-rp-dawn-gold dark:bg-rp-moon-pine dark:text-rp-moon-surface w-8 font-bold">
{{ articles_page.number }}
2024-12-19 09:56:25 +01:00
</li>
</span>
{% if articles_page.has_next() %}
2025-05-22 12:14:30 +02:00
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-8">
<a
class="block no-underline hover:no-underline"
href="{{ SITEURL }}/{{ articles_next_page.url }}"
title="Go to page {{ articles_page.next_page_number() }}"
>{{ articles_page.next_page_number() }}</a>
</li>
</span>
<span class="p-1">
</span>
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-8">
<a
class="block no-underline hover:no-underline"
href="{{ SITEURL }}/{{ last_page.url }}"
title="Go to last page"
>{{ articles_paginator.num_pages }}</a>
</li>
</span>
<span class="p-1">
<li class="text-center bg-rp-dawn-overlay dark:bg-rp-moon-overlay w-12">
<a
class="block no-underline hover:no-underline align-top"
href="{{ SITEURL }}/{{ articles_next_page.url }}"
title="Go to the next page"
><tt>&raquo;</tt></a>
</li>
</span>
2024-12-19 09:56:25 +01:00
{% endif %}
</ul>
</nav>
{% endif %}