Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

SvelteKit 2 - How to use routes with and without slugs?

$
0
0

I'm using SvelteKit 2 to make a client-side rendered (CSR) progressive web app (PWA).

I'd like to have routes like:

I've tried using the filesystem based router, where my directory structure looks like this:

src/routes/somethingsrc/routes/something/[slug]

It renders the something/[slug] route fine, but it's not rendering the /something route.

I've tried reading the SvelteKit 2 docs and it doesn't appear to cover this case.

Is there a way to make this routing work in SvelteKit 2?

Currently my workaround is to change the route to /something-else that doesn't match the slug route.


Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>