Skip to content
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

Remove [page].astro #389

Merged
merged 4 commits into from
Oct 7, 2024
Merged

Remove [page].astro #389

merged 4 commits into from
Oct 7, 2024

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