-
-
Notifications
You must be signed in to change notification settings - Fork 495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination: let data key be a function #1711
base: main
Are you sure you want to change the base?
Conversation
1e059fe
to
26be650
Compare
I just stumbled across https://www.webstoemp.com/blog/basic-custom-taxonomies-with-eleventy/ , which led me to #332 , which I see has a multitude of other issues linked to it. In case I didn't make it clear before (I don't think I did): this PR solves double pagination! (My other recently-opened PR #1697 also solves it, but I think this one is more elegant). That's exactly why I made this change - to make pagination work on tag pages. @zachleat your code in #332 (comment) is ok as an interim solution, but I think "double pagination" should be made possible in Eleventy, without having to copy-paste so much code (and you're kind of duplicating the chunking that the pagination plugin does internally). So, this is potentially all we need, to fulfil the enhancement item #461 , which I see has quite a few votes, and is currently pinned. Please consider getting this in! |
26be650
to
313c7fa
Compare
@zachleat any chance you could take a look at this? Has been more than 3 months. There has been no other progress in resolving the double pagination problem, as far as I'm aware. |
313c7fa
to
77b5ed5
Compare
@zachleat please? This PR has been up for a whole year now. I've been running this change in production for that whole time too. Would you mind reviewing it? |
So that pagination data key can be determined dynamically, based on a callback function that gets passed all template data. So you can do something like: ---js { pagination: { data: (data) => { return "collections." + data.foo; }, ...
77b5ed5
to
37ef0f6
Compare
Rebased against latest master and resolved conflicts |
So that pagination data key can be determined dynamically, based on a callback function that gets passed all template data. So you can do something like: