-
For an Eleventy site I’m running into the problem that tag pages get exceedingly long: for an example, see https://frontenddogma.com/topics/accessibility/. I’d like to cap this at 100 entries, and paginate these tag pages just like I would an index page (like https://frontenddogma.com/). As tag pages are already paginated pages (using The best I could find for this has been #134, but https://github.com/11ty/eleventy-base-blog/pull/9/files is not a viable solution because it’s not practical to duplicate every tag in metadata.json. Is there an Eleventy feature or an example that I’m missing? Has someone implemented this for their site and could share? |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 7 replies
-
I haven’t tried complex pagination like that yet, but I was thinking you could maybe use Maybe some good pointers in https://github.com/11ty/eleventy/search?q=lodash.chunk&type=issues |
Beta Was this translation helpful? Give feedback.
-
Thanks @pdehaan! I dug into this and one approach I found is @jeromecoupe’s https://www.webstoemp.com/blog/basic-custom-taxonomies-with-eleventy/. This may be a thing for me to customize to my needs, however it also begs the question whether Eleventy could offer something out of the box? @zachleat, are there any plans for advanced/multi-level pagination? I second what Jérôme writes in said post:
Thanks for considering! |
Beta Was this translation helpful? Give feedback.
-
If anyone sees this, does 1.0.0 provide a solution to this, or make this easier? (I cannot find anything in the release notes.) |
Beta Was this translation helpful? Give feedback.
-
In case anyone is interested, here is a repo showcasing what I currently use to paginate (multiple) taxonomies. |
Beta Was this translation helpful? Give feedback.
-
If you don’t mind, @zachleat, @pdehaan, does Eleventy 2.0.0 come with something built-in for this issue? |
Beta Was this translation helpful? Give feedback.
-
@j9t I came across this same problem recently. I have pagination for the "All Posts" and now I wanted to add pagination for "Posts per tag" where that page is already using the pagination. Wondering if you ever solved this issue and mind sharing your solution? Thanks. |
Beta Was this translation helpful? Give feedback.
-
have you seen pagebreak? I use it for double pagination (11ty's built-in pagination + pagebreak) |
Beta Was this translation helpful? Give feedback.
Yes, I managed to solve this back then.
What seems to have helped me was @zachleat and his comment in #332.
Please have a look—if that doesn’t work, I could look into sharing one of the two currently private projects, or try to trim the code so that it’s easier to adopt (it’s pretty tailored in both cases).