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

60 lines
2.8 KiB
HTML

{% if DEFAULT_PAGINATION %}
{% set first_page = articles_paginator.page(1) %}
{% set last_page = articles_paginator.page(articles_paginator.num_pages) %}
<nav class="flex justify-center items-center">
{% 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">
<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>
{% 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 -->
<span class="p-1">
<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 }}
</li>
</span>
{% if articles_page.has_next() %}
<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>
{% endif %}
</ul>
</nav>
{% endif %}