Site config
The sharpdocs.json file at the root of your docs folder.
sharpdocs.json lives at the root of DocsRoot and is required. It's loaded once at startup by ProjectRegistry.
The file shape depends on whether you're in single-project mode (the default) or multi-project mode.
Single-project shape
{
"title": "My library",
"description": "A small library.",
"github": "https://github.com/you/my-library",
"sidebar": [ /* groups */ ]
}
| Field | Purpose |
|---|---|
title |
Site title, shown in the header and browser tab. |
description |
Meta description, also used on the landing page. |
github |
Optional link to the repository. Rendered in the header. |
sidebar |
Sidebar structure. Each group has a label and a list of items. |
Sidebar shape
{
"sidebar": [
{
"label": "Fundamentals",
"items": [
{ "label": "Site config", "slug": "fundamentals/site-config" },
{ "label": "Search", "slug": "fundamentals/search" }
]
}
]
}
Each slug must match a markdown file under DocsRoot. Slugs are the file path relative to the root, extension stripped, forward slashes. foo/index.md collapses to the slug foo.
Validation
At startup, ProjectRegistry checks that every sidebar slug resolves to a page. A missing file throws:
sharpdocs.json references slug 'foo/bar' but no matching markdown page was found.
In single-project mode this throw is fatal — the site fails to boot. In multi-project mode it's caught and degrades just that one project.
Pages that exist on disk but aren't in the sidebar are still reachable via direct URL — they just don't appear in nav.
A root config with neither sidebar nor projects is valid: the site runs in single-project mode with an empty sidebar. Pages on disk are still reachable by URL.
Multi-project shape
To run as a multi-project site, replace sidebar with a projects array at the root:
{
"title": "Codezerg Libraries",
"projects": [
{ "id": "alpha", "path": "../codezerg-alpha" },
{ "id": "beta", "path": "../codezerg-beta" }
]
}
Each project keeps its own sharpdocs.json (with the single-project shape) at its referenced path. See Multi-project sites for the full rules.
Related
- Markdown pages — slug rules and frontmatter
- Reference: sharpdocs.json schema
- Multi-project sites