Reputation: 350
According to the new routing system you can now group routes and have specific layout files in each group. These files inherit for their parent layout files. You can omit this, by using [email protected]
.
However in want to omit the root layout file at src/routes/layout.svelte
. Is there a way to do that?
(Here is the guide: https://kit.svelte.dev/docs/advanced-routing#advanced-layouts)
Upvotes: 3
Views: 2859
Reputation: 89
+page@
append @
to the page you want to break out of.
https://learn.svelte.dev/tutorial/breaking-out-of-layouts
Upvotes: -1
Reputation: 86
You can achieve that by using groups. Wrap all files from routes into a folder named “(app)” and other routes you don’t want to use the default layout in another group. For example, If you want to have a layout for ‘/’ and ‘/blog’ but don’t use it on ‘/login’ then you could use the following folder structure:
src/routes/
├ (app)/
│ ├ blog/
│ │ └ +page.svelte
│ ├ +page.svelte
│ └ +layout.svelte
└ (login)/
├ login/
│ └ +page.svelte
└ +layout.svelte
Upvotes: 7
Reputation: 185225
You can't.
Just make the root layout empty (i.e. it only contains <slot />
).
Upvotes: 3