Configuration
createConfig() takes the values that differ between voraus sites and returns a complete Docusaurus
config. Everything else is shared.
import { createConfig } from '@voraus/docusaurus-theme'
export default createConfig({
title: 'voraus.example',
projectName: 'voraus-example',
})
The result is an ordinary Docusaurus config, so every Docusaurus command works unchanged. The full
option type is exported as VorausSiteOptions, so your editor completes and checks it.
Options
| Option | Type | Default | Description |
|---|---|---|---|
title | string | required | Site title, shown in the navbar and the browser tab. |
projectName | string | required | Repository name, and the site's vdoc path segment. |
version | string | 'dev' | Release version, the second vdoc path segment. Pass your package.json version. |
url | string | the vdoc docs host | Override only for sites not served from https://docs.vorausrobotik.com. |
baseUrl | string | the vdoc layout | Override only to opt out of /static/projects/<project>/<version>/. |
tagline | string | undefined | Short subtitle used in metadata. |
favicon | string | 'img/favicon.ico' | Path relative to the site's static directory. |
organizationName | string | 'vorausrobotik' | GitHub org that owns the site repository. |
docs | PresetOptions['docs'] | {} | Forwarded to plugin-content-docs. {} autogenerates the sidebar. false disables docs. |
blog | PresetOptions['blog'] | false | Forwarded to plugin-content-blog. |
pages | PresetOptions['pages'] | false | Forwarded to plugin-content-pages. |
customCss | string | string[] | [] | Your stylesheets. Loaded after the theme, so they win. |
navbarItems | NavbarItem[] | [] | Appended after the shared navbar defaults. |
iconLinks | VorausIconLink[] | [] | Links shown as a mark, appended after navbarItems. See Icon links. |
search | false | object | {} | Offline search options. false removes the search bar. |
themeConfig | Partial<ThemeConfig> | {} | Deep-merged onto the shared themeConfig. |
config | Partial<Config> | {} | Deep-merged onto the finished config. Escape hatch for anything above. |
What the shared defaults set
| Setting | Value |
|---|---|
onBrokenLinks | throw, see Strict builds |
onBrokenAnchors | throw |
markdown.mermaid | true, fenced mermaid blocks become diagrams |
future.v4 | true, the whole fleet migrates to Docusaurus v4 together |
i18n | English only |
colorMode | light default, respects prefers-color-scheme |
blog, pages | disabled |
Overriding a default
themeConfig and config are deep-merged, but arrays replace rather than merge:
export default createConfig({
title: 'voraus.example',
projectName: 'voraus-example',
themeConfig: {
docs: { sidebar: { hideable: true } },
prism: { additionalLanguages: ['python', 'bash'] },
},
config: {
plugins: ['@docusaurus/plugin-ideal-image'],
},
})
Setting themeConfig.navbar.items would therefore discard the shared navbar. Use navbarItems to
append instead, as shown in Customizing.
Docs at the site root
By default the docs sit under a /docs/ segment. To drop it:
export default createConfig({
title: 'voraus.example',
projectName: 'voraus-example',
version: pkg.version,
docs: { routeBasePath: '/', sidebarPath: './sidebars.ts' },
})
This is routeBasePath, not baseUrl. baseUrl is where the site is deployed; routeBasePath is
where the docs plugin mounts inside it.
It mounts the docs at the root but does not create a page at the root. Give your landing document
slug: / in its front matter, or the build fails its own link check.