Loading...
Loading...
Skill for writing and updating scalar.config.json — Scalar Docs configuration reference for users and LLMs.
npx skill4agent add scalar/scalar scalar-docsscalar.config.jsonscalar.config.jsonscalar.config.json5https://registry.scalar.com/@scalar/schemas/configjson.schemaDownload.enable"scalar": "2.0.0"npx @scalar/cli project init{
"$schema": "https://registry.scalar.com/@scalar/schemas/config",
"scalar": "2.0.0",
"info": {
"title": "My Documentation",
"description": "The best documentation you've read today"
},
"navigation": {
"routes": {
"/": {
"title": "Introduction",
"type": "page",
"filepath": "docs/introduction.md"
}
}
}
}npx @scalar/cli project check-config| Property | Type | Description |
|---|---|---|
| | JSON Schema URL for editor autocomplete and validation |
| | Configuration version. Use |
| | Project metadata (title, description) |
| | Navigation structure (header, routes, sidebar, tabs) |
| | Site-level settings (domain, theme, head, logo, routing) |
| | Relative path to assets folder from config root |
{
"info": {
"title": "My Documentation",
"description": "Comprehensive guides for our API"
}
}navigation.routestype: "spacer""header": [
{ "type": "link", "title": "Home", "to": "/" },
{ "type": "spacer" },
{ "type": "link", "title": "Log in", "to": "https://dashboard.example.com/login", "newTab": true },
{ "type": "link", "title": "Register", "style": "button", "icon": "phosphor/regular/user-plus", "to": "https://...", "newTab": true }
]titletype"link""spacer"tostyle"button""link"iconnewTab"sidebar": [
{ "title": "Log in", "url": "https://...", "style": "button", "newTab": true }
]"tabs": [
{ "title": "API", "path": "/api", "icon": "phosphor/regular/plug" }
]type: "page""/getting-started": {
"type": "page",
"title": "Getting Started",
"filepath": "docs/getting-started.md",
"description": "Optional SEO description",
"icon": "phosphor/regular/rocket",
"showInSidebar": true,
"layout": { "toc": true, "sidebar": true }
}toctruesidebartrueshowInSidebar: falsetype: "openapi""/api": {
"type": "openapi",
"title": "My API",
"filepath": "docs/api-reference/openapi.yaml",
"icon": "phosphor/regular/plug"
}"/api": {
"type": "openapi",
"title": "My API",
"namespace": "my-organization",
"slug": "your-api"
}"/api": {
"type": "openapi",
"title": "My API",
"url": "https://example.com/openapi.json"
}folderflatnestedconfigtype: "group""/products": {
"type": "group",
"title": "Products",
"mode": "flat",
"icon": "phosphor/regular/package",
"children": {
"/docs": { "type": "page", "title": "Documentation", "filepath": "docs/documentation.md" },
"/api": { "type": "openapi", "title": "API Reference", "filepath": "openapi.yaml" }
}
}flatnestedfoldertype: "link""/github": {
"type": "link",
"title": "GitHub",
"url": "https://github.com/org/repo",
"icon": "phosphor/regular/github-logo"
}"logo": "https://example.com/logo.svg"
// or
"logo": {
"darkMode": "https://example.com/logo-dark.svg",
"lightMode": "https://example.com/logo-light.svg"
}defaultalternatemoonpurplesolarizedbluePlanetdeepSpacesaturnkeplermarslaserwavenone"theme": "purple"https://<subdomain>.apidocumentation.com"subdomain": "your-docs"https://docs.example.com"customDomain": "docs.example.com""subpath": "/guides""layout": {
"toc": true,
"header": true
}"head": {
"title": "My Documentation",
"meta": [
{ "name": "description", "content": "API documentation" },
{ "property": "og:image", "content": "https://example.com/og.png" }
],
"styles": [{ "path": "docs/assets/custom.css", "tagPosition": "head" }],
"scripts": [{ "path": "docs/assets/analytics.js", "tagPosition": "bodyClose" }],
"links": [{ "rel": "icon", "href": "/favicon.png" }]
}scriptsstyleslinks/favicon.pngtagPosition"head""bodyOpen""bodyClose""footer": {
"filepath": "docs/footer.html",
"belowSidebar": true
}"routing": {
"redirects": [
{ "from": "/old-path", "to": "/new-path" },
{ "from": "/old-path/:wildcard", "to": "/new-path" },
{ "from": "/old-path/:pathMatch(.*)*", "to": "/new-path" }
]
}"routing": {
"guidePathPattern": "/docs/:slug",
"referencePathPattern": "/api/:slug"
}"assetsDir": "docs/assets"siteConfig.headguidesreferencesnavigation.routesnpx @scalar/cli project upgradenpx @scalar/cli project preview| Command | Description |
|---|---|
| Create scalar.config.json |
| Validate config |
| Local preview (port 7971) |
| Publish from local files |
| Publish from linked GitHub repo |
| Migrate from Docs 1.0 |
customDomainsubdomainsubpath.mdxfilepath"layout": { "toc": false }configauthenticationdocsdns.scalar.com