Navigation
The _meta.json schema: ordering, titles, precedence, and category separators.
What _meta.json controls
Drop a _meta.json file in any content/ folder (including the root) to control that folder’s slice of the sidebar: order, display titles, and category grouping, independent of file names or frontmatter.
{
"items": {
"introduction": { "order": 1 },
"getting-started": { "title": "Quick Start", "order": 2 }
}
}Each key under items is a file or folder name (no extension) relative to that _meta.json.
Fields
title— overrides the display title, in both the sidebar and on the page itself.order— a sort key. Lower sorts first. Items without an explicit order default to999and sort after everything that has one.icon— a name from the curated icon set (see Components). Set here, it wins over the same page’s frontmattericon, so a section can standardize icons without editing every file. On a folder entry, this is also the only way to give a folder an icon when it has no index page of its own.type: "separator"— turns this entry into a non-clickable heading (see below) instead of pointing at a real file. Separators can carry anicontoo.hidden: true— leaves the page out of the sidebar, the previous/next pager, and<Cards auto>. On a folder entry, it hides the whole folder. The page still builds, keeps its URL, and stays in search andllms.txt, so you can link to it from a header link or another page.
Precedence
A page’s title and order can come from four places. From highest priority to lowest:
_meta.jsonin the page’s directory- The page’s own sidecar
name.meta.json - The page’s own frontmatter
- Auto-derived from the filename (title-cased) and
order: 999
Each field resolves independently. A page can take its order from _meta.json while its title still comes from frontmatter, if _meta.json doesn’t set a title for that key. icon follows the same chain, except there’s no auto-derived fallback — a page with no icon set anywhere just shows none.
This means _meta.json is the right place to reorganize navigation without touching content files: renaming a sidebar label, reordering pages, or moving a page into a different category is a one-line change in _meta.json, no matter what the page’s own frontmatter says.
Category separators
Set type: "separator" to inject a non-clickable heading into the sidebar at a given position. This groups pages under labels like Getting Started or Guides without those labels being real pages:
{
"items": {
"getting-started-heading": { "type": "separator", "title": "Getting Started", "order": 1 },
"introduction": { "order": 2 },
"getting-started": { "title": "Quick Start", "order": 3 },
"guides-heading": { "type": "separator", "title": "Guides", "order": 4 },
"writing-content": { "order": 5 }
}
}The separator’s key (getting-started-heading above) doesn’t need to match a real file; it only needs to be unique within that items map. Separators sort into the list by order exactly like real items, so they interleave naturally with the pages around them. This site’s own sidebar is built this way — see content/_meta.json in the repository.
Folders
A folder’s own title and order can be set from its parent directory’s _meta.json, keyed by the folder name:
{
"items": {
"deployment": { "title": "Deploy", "order": 6 }
}
}This only applies to folders that don’t resolve to a real document (no index.md/index.svx inside them). If the folder has an index page, that page’s own title wins, since it’s a real page with its own metadata.
Header, logo and footer
On docs pages, the sidebar runs the full height of the window. Your logo sits at the top of it. A bar over the content holds your header links, search, the theme toggle and the GitHub button. The footer sits under the content.
These parts are snippets in src/routes/+layout.svelte, handed to the docs layout with setSiteChrome():
| Snippet | What it holds |
|---|---|
brand | Your logo and site name. A collapsed sidebar shows only the first 2rem of it, so start it with a logo mark. |
links | Header links, such as a blog. They sit left of search. Optional. |
actions | Search, the theme toggle and the GitHub button. |
footer | The footer content. Optional. |
To add a header link, add an <a> to the links snippet:
{#snippet links()}
<nav class="primary-nav" aria-label="Primary">
<a href={resolve('/docs')}>Docs</a>
<a href="https://example.com/blog">Blog</a>
</nav>
{/snippet}Pages outside /docs, such as the landing page, show the same snippets in a full-width header.