Skip to content

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:

docskit.config.tsTypeScript
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

FieldTypeDefault or requirement
namestringRequired; must not be blank
descriptionstringRequired; default description for pages
urlstringRequired HTTP or HTTPS URL for canonical and social metadata
titlestringname
basePathstring"/"
langstring"en"
repositorystringOmitted; set it to add GitHub to the navbar
copyrightstring"<name> contributors", using your site name
FieldTypeDefault or requirement
navigationGroup[]Required; guide sidebar groups
apiNavigationGroup[][]; API sidebar groups
linksNavLink[]Documentation; also API references when apiNavigation is nonempty
footerLinksFooterLink[][]

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

FieldTypeDefault
logoThemeAssetSite name is shown when omitted
faviconThemeAssetOmitted
imagestring"/og.png" when automatic generation is enabled
imageAltstringSite name and description, separated by an em dash
ogOgImageConfig or falseAutomatic 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:

FieldTypeDefault
titlestringSite title
highlightstringOmitted; optional accent-colored headline line
descriptionstringSite description
footerstring"Documentation"; the public host appears separately
logostring or falseSite'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:

FieldTypeDefault
versioning.currentLabelstring"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

FieldTypeDefault
homepagestringBuilt-in homepage renders the documentation overview
pagesRecord<string, string>No extra pages; route paths map to React component modules
componentsstringBuilt-in Markdown component map
stylesstring[][]; 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.