Skip to content

Conversation

@floatingpurr
Copy link
Contributor

tl;dr, Delete src/pages/posts/[page].astro

Hi folks, just a quick update about pagination. I noticed that there were two identical files: [page].astro and [...page].astro. As per the Astro doc, we only need one of them:

  • /posts/[page].astro would generate the URLs /posts/1, /posts/2, /posts/3, etc.
  • /posts/[...page].astro would generate the URLs /posts, /posts/2, /posts/3, etc.

I've removed src/pages/posts/[page].astro to avoid duplication and to maintain consistency with the "legacy" URL pattern.

@satnaing
Copy link
Owner

satnaing commented Oct 2, 2024

Thanks for your PR.
This approach has one issue.
We can't access /posts/1 anymore.
At the moment, we have to choose 1 or the other.

Either duplicate [page] or no /posts/1.

@floatingpurr
Copy link
Contributor Author

Thanks for your PR. This approach has one issue. We can't access /posts/1 anymore. At the moment, we have to choose 1 or the other.

Either duplicate [page] or no /posts/1.

Yep, but that is how Astro works. Do we really need /posts/1?

@satnaing
Copy link
Owner

satnaing commented Oct 3, 2024

@floatingpurr
Yep, you're right.
We can ignore posts/1 part.
Plz, can you also update the tag page and resolve the conflicts so that I can merge.

@floatingpurr
Copy link
Contributor Author

It should be fine now.

@satnaing satnaing merged commit b16fba8 into satnaing:main Oct 7, 2024
1 check passed
@floatingpurr
Copy link
Contributor Author

@satnaing,sorry for fixing conflicts without fixing tags!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants