Configuration reference
Export a configuration with defineDocs from docskit.config.ts. The config is
shared by the renderer and browser components. Keep secrets and server-only
imports out of it.
Minimal configuration
The required fields are name, description, url, and navigation:
import { defineDocs } from "@pinanek/docskit";
export default defineDocs({
name: "My Project",
description: "Documentation for My Project.",
url: process.env.DOCS_SITE_URL ?? "https://docs.example.com",
basePath: process.env.DOCS_BASE_PATH ?? "/",
navigation: [
{
label: "Start here",
items: [{ label: "Overview", href: "/docs/" }],
},
],
});
Use a public HTTP or HTTPS origin for url. basePath is the deployment
pathname, such as /project/. Docskit normalizes it with a trailing slash.
Site identity
| Field | Type | Default or requirement |
|---|---|---|
name | string | Required; must not be blank |
description | string | Required; default description for pages |
url | string | Required HTTP or HTTPS URL for canonical and social metadata |
title | string | name |
basePath | string | "/" |
lang | string | "en" |
repository | string | Omitted; set it to add GitHub to the navbar |
copyright | string | "<name> contributors", using your site name |
Navigation
| Field | Type | Default or requirement |
|---|---|---|
navigation | Group[] | Required; guide sidebar groups |
apiNavigation | Group[] | []; API sidebar groups |
links | NavLink[] | Documentation; also API references when apiNavigation is nonempty |
footerLinks | FooterLink[] | [] |
A NavLink has label and href strings. A Group has a label string and an
items array containing links or nested groups. A FooterLink adds an optional
icon string to NavLink.
Internal page links use routes such as /docs/installation/, without deployment
or version prefixes. An explicit links array replaces the default navbar links.
See Navigation and links for complete examples.
Footer icon names are case-sensitive Lucide export names. "github" selects the
custom GitHub SVG. An omitted or unknown icon renders a text link.
Assets and social metadata
| Field | Type | Default |
|---|---|---|
logo | ThemeAsset | Site name is shown when omitted |
favicon | ThemeAsset | Omitted |
image | string | "/og.png" when automatic generation is enabled |
imageAlt | string | Site name and description, separated by an em dash |
og | OgImageConfig or false | Automatic image generation, unless image supplies a custom image |
A ThemeAsset is either a URL string or an object with light and dark URL
strings. Public paths such as /logos/logo.svg refer to files under public/.
See Branding for theme behavior and footer examples.
OgImageConfig accepts these optional fields:
| Field | Type | Default |
|---|---|---|
title | string | Site title |
highlight | string | Omitted; optional accent-colored headline line |
description | string | Site description |
footer | string | "Documentation"; the public host appears separately |
logo | string or false | Site's local light logo, when available |
Automatic output is a 1200 × 630 PNG. Set image to a custom image URL to replace
it, or set og: false to disable generation. og.logo: false removes the logo
from an otherwise generated image. See Social images
for examples and supported local image formats.
Versioning
Versioning is disabled when omitted or set to false. Set versioning: {} to
enable it with these defaults:
| Field | Type | Default |
|---|---|---|
versioning.currentLabel | string | "Next (unreleased)"; must not be blank |
versioning.defaultVersion | "latest" or "next" | "latest" |
latest puts the latest published snapshot at the default production URLs. Before
the first publication, those URLs show Next. next keeps the current content at
the default URLs. Development opens Next at the default URLs in either case.
Publication state is stored in versions/versions.json, separately from this
configuration. See Versioning.
Project modules
| Field | Type | Default |
|---|---|---|
homepage | string | Built-in homepage renders the documentation overview |
pages | Record<string, string> | No extra pages; route paths map to React component modules |
components | string | Built-in Markdown component map |
styles | string[] | []; custom CSS loads after built-in CSS |
Module and stylesheet paths are relative to the docs project. homepage selects
a module with a default React component export. pages maps static routes such
as /logos/ to modules with the same export. components selects a module with a
default MDX component map export. Read Pages
and Components and styles for working
examples.
Environment variables
Use DOCS_SITE_URL and DOCS_BASE_PATH in the config as shown in the minimal
example. The CLI loads DOCS_ variables through Vite's environment loading,
including .env, .env.local, and mode-specific files in the docs project.
Values already set in the process environment take precedence.
These values are supplied at development or build time. Changing a static host's runtime environment does not rewrite an existing build. Rebuild after changing the public origin or deployment path. See Deployment.
For exported TypeScript types and function signatures, open the generated configuration API.