Configuration
Configure sources, navigation, themes and code blocks.
defineConfig accepts an object or an asynchronous factory receiving root and command. Configuration is discovered from root yupress.config.ts or .mts; use --config for another file. Multiple discovered config files are an error.
content.srcDir,includeandexcludecontrol the source inventory.content.metadataTypenames an application type for generated metadata declarations.content.publish(document)selects the published collection after inventory validation.siteowns title, locales, base, sections, links, home presets and footer content.themenames a full theme package or an explicit local./theme.tsxmodule.documentoptionally selects a local document renderer relative to the project root.pluginscontains content lifecycle extensions;viteaccepts Vite options or an asynchronous options factory.outputDircontrols generated content cache output, defaulting to.cache/press; it is separate from the public site output selected with--out-dir.
Do not commit .cache/press/ or dist/. The cache contains generated manifests, loaders, metadata and build intermediates. Recreate it with generate rather than editing generated files.
Code blocks
All fields are optional. code: false disables code enhancement. See code blocks for language fallbacks and built-in light/dark themes.
Locales and navigation
Declare language source directories and URL prefixes in site.locales. Document IDs connect translations; the default theme falls back to the target language home and shows a notice when a translation is missing. Locale UI messages and home presets are consumer configuration, not a shared application catalog.
site.sections declares document order and groups against the validated inventory. Duplicate, missing or conflicting references are errors; navigation does not discover extra content. Use site.home or locale-specific home presets to combine Markdown content with hero/features.
Site sections list document IDs (without .md) in reading order. For example content/guide/setup.md has ID guide/setup; content/index.md has ID index. A locale source prefix is removed before assigning IDs. Groups reference that same inventory; no extra discovery occurs during rendering.