Replies: 3 comments 1 reply
-
No, but you can always define a layout per route. If you want something similar to Gatsby, which allows you to select a layout in the post page, you can integrate Kit with mdsvex and use its layout. |
Beta Was this translation helpful? Give feedback.
-
__layout.svelte files are just svelte components that take a main slot. you can import any layout file as you would a regular component file
You get no benefits though of route inheritance, so in that case it will be better to setup specific routes for special [slug]'s |
Beta Was this translation helpful? Give feedback.
-
On mobile so haven't been able to test this, but you could possibly use param matchers to determine which layout matches for that slug. [slug=foo]@foo.svelte https://kit.svelte.dev/docs/routing#advanced-routing-matching |
Beta Was this translation helpful? Give feedback.
-
hardcoding a file to include @foo.svelte is not always possible when you are dynamically generating routes via [slug].svelte etc. Is there a way to call layouts in load based on CMS data or something like that?
Beta Was this translation helpful? Give feedback.
All reactions