Does pagination support skipping/offsetting? #1843
-
I'm working on migrating my Jekyll site to 11ty and am so far pleased with how pagination is built into the framework! Very cool that you can reuse pagination in front matter for permalinks. I have a unique need: I want So far, I've gotten very close to achieving this with the following directory structure:
The root blog index does this: ---
title: Blog
layout: blog
permalink: /blog/
---
{%- comment -%}First 20 posts on /blog/{%- endcomment -%}
{%- assign posts = collections.post | limit: 20 -%}
{% for post in posts %}
<li><a href="{{ post.url }}">{{ post.date | date: '%b %d, %Y' }} - {{ post.data.title }}</a></li>
{% endfor %} And the nested page index is paginated like so: ---
title: Blog (Page {{ pagination.pageNumber }})
layout: blog
permalink: "/blog/page/{{ pagination.pageNumber | plus: 1 }}/"
pagination:
data: collections.post
size: 20
alias: posts
---
{% for post in posts %}
<li><a href="{{ post.url }}">{{ post.date | date: '%b %d, %Y' }} - {{ post.data.title }}</a></li>
{% endfor %} Now, I'm also hoping to get rid of the duplicate Is there any way I can tell the paginator to skip the first page? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think https://www.11ty.dev/docs/pagination/#remapping-with-permalinks might have some pointers. |
Beta Was this translation helpful? Give feedback.
I think https://www.11ty.dev/docs/pagination/#remapping-with-permalinks might have some pointers.