Add a way to have paginated pages be nested under a sub-route #19
edazpotato
started this conversation in
Proposal
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Add a way to have paginated pages be under a sub-route (the Motivation section explains this in more detail).
I'm not sure what exactly this would look like in practise, but Astro should provide some way to do this out of the box because surely this would be a common use-case.
This isn't a proper rfc yet, I'm just looking for feedback on this idea an suggestions on what it could look like if it were implemented into Astro,
Motivation
In order to have a routing structure like this
I currently need to have something like this:
which seems like it would work but it has a multitude of issues, mainly revolving around the
paginate
function. I have a pagination component that I use elsewhere in the app that uses the stuff inpage
prop that thepaginate
function generates. I want to use this pagination component for the posts list page, but that didn't work because I can't use the normal pagination function due to it not supporting this use case (I did try modifyingpaginate
's output but that was an absolute nightmare), so I needed to implement my own pagination system in order to support the routing structure I wanted. That wouldn't be too tough normally, but I also needed to generate thepage
prop and make it look identical to the one outputted by the built-inpaginate
function so that the pagination component kept working.Basically it's a massive, complex mess that took hours to implement, in order to get a relatively simple output.
Beta Was this translation helpful? Give feedback.
All reactions