Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Catch all routes ex. [...slug].svelte #1092

Closed
rlindskog opened this issue Feb 19, 2020 · 4 comments
Closed

Catch all routes ex. [...slug].svelte #1092

rlindskog opened this issue Feb 19, 2020 · 4 comments

Comments

@rlindskog
Copy link

rlindskog commented Feb 19, 2020

Is your feature request related to a problem? Please describe.
I'd like the ability to have catch all functionality for scenarios where I don't know the number of parameters ahead of time.

Describe the solution you'd like
Ability to create a catch-all route by naming a file.
Example:

  • /src/routes/posts/[...slug].svelte
  • user navigates to /posts/a/b
  • page.params would then contain { "slug": ["a", "b"] }

Additional context
Inspired by next.js: https://nextjs.org/docs/routing/dynamic-routes#catch-all-routes

@Conduitry
Copy link
Member

These already exist - #545 / #607 - but we still haven't gotten around to documenting them yet 😬

@kevmodrome
Copy link
Contributor

I made a PR for this: #1077

@Conduitry
Copy link
Member

Thanks! Made a couple of adjustments, merged, and deployed.

@rlindskog
Copy link
Author

Excellent, thanks everyone!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants