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

refactor(www): use optional dynamic route params in the docs/[...slug].tsx route #2770

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

bhb603
Copy link
Contributor

@bhb603 bhb603 commented Nov 22, 2024

Resolves #1750

  • refactor the docs/[...slug].tsx to use optional route params: docs/[[version]]/[...slug]
  • cleaned up the docs/index.tsx handler as well

Testing

I believe this preserves current routing behavior:


export const handler: Handlers<void> = {
GET(ctx) {
const slug = ctx.params.slug;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was unclear to me how this handler could ever have ctx.params.slug, since it's not a dynamic route, so I removed.

But if there is another way and I'm mistaken, LMK and we can add this back!

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@bhb603 bhb603 force-pushed the main branch 2 times, most recently from 8be8505 to 230c7bb Compare December 8, 2024 19:44
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.

www: refactor docs/[...slug].tsx to make use of optional dynamic params
1 participant