make pagination numbers optional

This commit is contained in:
madrilene 2024-02-12 11:22:25 +01:00
parent 351cef7ac6
commit a1105085ec
2 changed files with 4 additions and 1 deletions

View file

@ -37,7 +37,8 @@ module.exports = {
pagination: 'Blog',
paginationPage: 'Page',
paginationPrevious: 'Previous',
paginationNext: 'Next'
paginationNext: 'Next',
paginationNumbers: true
},
details: {
aria: 'section controls',

View file

@ -47,12 +47,14 @@ masonry: true
<a href="{{ pagination.href.previous }}"> {{ meta.blog.paginationPrevious }} </a>
{% else %} {{ meta.blog.paginationPrevious }} {% endif %}
</li>
{% if meta.blog.paginationNumbers %}
{%- for pageEntry in pagination.pages %}
<li>
<a href="{{ pagination.hrefs[ loop.index0 ] }}" id="link_{{ loop.index }}" aria-labelledby="prefix link_{{ loop.index }}" {% if page.url == pagination.hrefs[ loop.index0 ] %} aria-current="page" {% endif %}>
{{ loop.index }}</a>
</li>
{%- endfor %}
{% endif %}
<li>
{% if pagination.href.next %}
<a href="{{ pagination.href.next }}">{{ meta.blog.paginationNext }}</a>