Skip to content
Domphy

Configuration

defineConfig

import { defineConfig } from "@domphy/press"

export default defineConfig({ /* UserConfig */ })

defineConfig builds a new SiteConfig — it is not a passthrough. Input type is UserConfig (base / srcDir / outDir / head optional). Defaults applied:

FieldDefault
base"/"
srcDir"."
outDir"dist"
head[]
themeConfigmerged onto { nav: [], sidebar: {} }

The CLI runs loaded plain-object configs through defineConfig as well, so they get the same defaults.

srcDir and outDir on the returned SiteConfig stay as those path strings (relative unless you pass an absolute path). The CLI resolve()s them against process.cwd() at build / dev time.

SiteConfig

FieldTypeDescription
titlestringSite title — appended to page titles
descriptionstringDefault meta description
basestringDeploy base path (e.g. "/" or "/docs/") — internal nav/sidebar/hero links, root-relative links and images written in the Markdown, and canonical/sitemap/OG URLs are prefixed automatically (write them root-relative). domphy-press dev/preview serve the site at this prefix too. Default "/"
hostnamestringCanonical hostname for sitemap and OG (e.g. "https://example.com")
srcDirstringMarkdown source directory. Default "." (relative). The CLI resolve()s it against process.cwd() at build/dev time
outDirstringBuild output directory. Default "dist" (relative). Same CLI resolve as srcDir
headstring[]Raw <head> tags injected verbatim (analytics, icons). Default []
themeConfigThemeConfigNavigation, sidebar, footer, social links, etc. defineConfig merges the value you pass onto { nav: [], sidebar: {} }
lastUpdatedboolean?Show last-updated date from git log. Default: false
continueOnErrorboolean?Keep building (and exit 0) when individual pages fail. Default: false — any page error fails the build
cspNoncestring?Content-Security-Policy nonce stamped on every inline <script>/<style> press emits and forwarded to @domphy/app SSR
localesRecord<string, LocaleConfig>?i18n locale routing
markdownRecord<string, never>?Reserved for future markdown plugin configuration. Currently a no-op.

ThemeConfig

FieldTypeDescription
navNavItem[]Top navigation bar
sidebarRecord<string, SidebarItem[]>Sidebar keyed by route prefix — longest match wins
logostring | { light: string; dark: string }?Logo image — single URL or separate light/dark variants
searchfalse | { placeholder?, limit? }?Built-in local search. Pass false to disable
footerMessagestring?Footer content (HTML via rawHtml() — keep to markup you control)
socialLinksSocialLink[]?GitHub, Twitter, Discord, etc. icon links in header
editLinkEditLink?"Edit this page" link (pattern: https://github.com/…/:path)
outline{ level: [number, number] }?TOC heading levels. Default: [2, 3]
tocTitlestring?TOC section heading text. Default: "On this page"
mermaidboolean | { cdn? }?Enable Mermaid diagrams (loaded via CDN)
announcementBar{ id?, text, dismissible? }?Dismissible banner above the page. text is HTML via rawHtml() (same contract as footerMessage)
slotsLayoutSlots?Override individual layout regions with custom Domphy elements
{ text: string; link?: string; items?: { text: string; link: string }[] }
  • Flat link: { text: "Guide", link: "/guide/" }
  • Dropdown: { text: "Packages", items: [...] }

SidebarItem

{
  text: string
  link?: string
  items?: SidebarItem[]
  badge?: { text: string; type?: "tip" | "info" | "warning" | "danger" }
  collapsed?: boolean
}
{ icon: "github" | "twitter" | "discord" | "youtube" | "linkedin" | "mastodon" | "npm" | "bluesky" | string; link: string; ariaLabel?: string }

For custom icons, pass a URL or SVG data URI as icon.