Layouts
A layout file wraps every Page in its folder and below with shared Components, such as navigation and a footer.
A layout.mdx file wraps every Page in its folder and below. It holds the parts every Page shares, such as navigation and a footer.
sites/www/layout.mdxwraps every Pageblog/layout.mdxwraps the blog Pages, inside the root layout
Reference
MDX with one <Slot />, where the Page renders. Layouts nest from the root down.
| Key | Type | Holds |
|---|---|---|
theme | path | A Theme for this subtree |
banner | string | A line shown above every Page below |
Examples
Minimal
<Slot />Leaseline
<Navigation />
<Slot />
<CallToAction heading="Start a 14-day trial" action="/checkout/ pro" />
<Footer />What it builds
The SiteBuilder applies the layout to each Page below at compile time.
- no record of its own; each
Pagecarries its resolved layout - a layout change republishes every Page below it with the next
Site.publish
Good to know
- A
(group)folder holds its own layout without adding a URL segment; see route segments.