Next.js Discord

Discord Forum

how to paginate Catch-all Segments

Unanswered
Singapura posted this in #help-forum
Open in Discord
SingapuraOP
I retrieved all the categories from contentful and filtered them by the parent category until I got something like this:
[
  { categories: [ 'tech', 'cybersecurity' ] },
  { categories: [ 'travel' ] },
  { categories: [ 'how-to' ] }
]

Each of these categories can have their own pages, so /tech/2, /tech/3, /tech/cybersecurity, /tech/cybersecurity/2, etc.
My file directory looks something like this: /[...categories]/[page]. Before I start figuring it out on my own, is there an example on how to do this the best way possible?

0 Replies