Configuration

All configuration lives in zpress.config.ts at your repo root. Use defineConfig for type safety and autocompletion.

import { defineConfig } from 'zpress'

export default defineConfig({
  title: 'My Docs',
  description: 'Project documentation',
  sections: [{ text: 'Introduction', link: '/intro', from: 'docs/intro.md' }],
})

Configuration is loaded via c12, which supports .ts, .js, .mjs, and .json formats.

Top-level fields

FieldTypeDefaultDescription
titlestringSite title shown in browser tab and home page
descriptionstringMeta description and home page hero headline
taglinestringHero tagline below the headline on the home page
sectionsEntry[](required)Information architecture tree
nav'auto' | NavItem[]'auto'Top navigation bar
featuresFeature[]Explicit home page feature cards (replaces auto-gen)
appsWorkspaceItem[]Monorepo app metadata for home/landing pages
packagesWorkspaceItem[]Monorepo package metadata for home/landing pages
workspacesWorkspaceGroup[]Custom named groups of workspace items
openapiOpenAPIConfigOpenAPI spec integration for interactive API docs
excludestring[]Glob patterns excluded globally across all sources

Entry

Each node in sections is an Entry. What you provide determines what it is:

Page — single file:

{ text: 'Architecture', link: '/architecture', from: 'docs/architecture.md' }

Page — inline content:

{ text: 'Overview', link: '/overview', content: '# Overview\nProject overview content.' }

Page — async content generator:

{ text: 'Status', link: '/status', content: async () => fetchStatus() }

Section — explicit children:

{
  text: 'Guides',
  items: [
    { text: 'Quick Start', link: '/guides/quick-start', from: 'docs/guides/quick-start.md' },
    { text: 'Deployment', link: '/guides/deployment', from: 'docs/guides/deployment.md' },
  ],
}

Section — auto-discovered from glob:

{ text: 'Guides', prefix: '/guides', from: 'docs/guides/*.md' }

Entry fields

FieldTypeDescription
textstringDisplay name in sidebar and nav
linkstringOutput URL path
fromstringSource file path or glob pattern
prefixstringURL prefix for glob-discovered children
contentstring | () => Promise<string>Inline or generated markdown content
itemsEntry[]Explicit child entries
collapsiblebooleanMake sidebar section collapsible
excludestring[]Exclude globs scoped to this entry
hiddenbooleanHide from sidebar (page still routable)
frontmatterFrontmatterInjected YAML frontmatter
textFrom'filename' | 'heading' | 'frontmatter'Text derivation for discovered children
textTransform(text, slug) => stringTransform derived text
sort'alpha' | 'filename' | comparatorSort order for discovered children
recursivebooleanDirectory-based nesting for recursive globs
indexFilestringSection header filename (default: "overview")
iconstringIconify identifier for sidebar icon rail
cardCardConfigLanding page card metadata
isolatedbooleanSeparate sidebar namespace (requires link)

WorkspaceItem

Metadata for monorepo apps and packages. Drives home page cards, landing page cards, and introduction content.

{
  text: 'API',
  icon: 'devicon:hono',
  iconColor: 'blue',
  description: 'REST API with typed routes',
  tags: ['hono', 'typescript'],
  docsPrefix: '/apps/api',
}
FieldTypeRequiredDescription
textstringyesDisplay name
iconstringnoIconify identifier
iconColorstringnoCSS class suffix for icon color
descriptionstringyesShort description for cards
tagsstring[]noTechnology tags (kebab-case)
badge{ src: string; alt: string }noDeploy badge image
docsPrefixstringyesDocs path prefix matching sections
fromstringnoContent source relative to workspace base
itemsEntry[]noExplicit child entries
sort'alpha' | 'filename' | fnnoSort order for auto-discovered children
textFrom'filename' | 'heading' | 'frontmatter'noText derivation for discovered children
textTransform(text, slug) => stringnoTransform derived text
recursivebooleannoEnable recursive directory nesting
indexFilestringnoSection header filename (default: "overview")
excludestring[]noExclude globs scoped to this item
collapsiblebooleannoMake sidebar section collapsible
frontmatterFrontmatternoInjected frontmatter for all child pages

WorkspaceGroup

Custom named groups beyond the built-in apps and packages. Each group receives the same card and landing page treatment.

{
  name: 'Integrations',
  description: 'Third-party service connectors',
  icon: 'pixelarticons:integration',
  items: [
    { text: 'Stripe', description: 'Payment processing', docsPrefix: '/integrations/stripe' },
  ],
}
FieldTypeDescription
namestringGroup display name
descriptionstringShort description
iconstringIconify identifier
itemsWorkspaceItem[]Workspace items in this group
linkstringURL prefix override (defaults to /${slugify(name)})

CardConfig

Controls how an entry appears as a card on its parent section's auto-generated landing page.

{
  icon: 'devicon:hono',
  iconColor: 'api',
  scope: 'apps/',
  description: 'REST API with typed routes',
  tags: ['Hono', 'REST'],
  badge: { src: '/logos/vercel.svg', alt: 'Vercel' },
}
FieldTypeDescription
iconstringIconify identifier
iconColorstringCSS class suffix for .workspace-icon--{color}
scopestringScope label above the card name
descriptionstringShort description (overrides auto-extracted)
tagsstring[]Technology tag badges
badge{ src: string; alt: string }Deploy badge image

Explicit navigation bar configuration. Used when nav is an array instead of 'auto'.

nav: [
  { text: 'Guides', link: '/guides/sections-and-pages' },
  { text: 'API', link: '/api/overview' },
]
FieldTypeDescription
textstringDisplay text
linkstringTarget URL path
itemsNavItem[]Dropdown children
activeMatchstringRegex pattern for active state matching
iconstringIconify identifier (required on top-level explicit items)

Set nav: 'auto' to generate one nav item per non-isolated top-level section.

Feature

Explicit feature card for the home page. Replaces the auto-generated cards derived from top-level sections.

features: [
  {
    text: 'Getting Started',
    description: 'Set up zpress and create your first site.',
    link: '/getting-started',
    icon: 'pixelarticons:speed-fast',
  },
]
FieldTypeDescription
textstringCard title
descriptionstringShort description below title
linkstringClick target URL
iconstringIconify identifier

OpenAPIConfig

Configuration for OpenAPI spec integration.

FieldTypeDefaultDescription
specstring(required)Path to openapi.json from repo root
prefixstring(required)URL prefix for API operation pages
titlestring'API Reference'Sidebar group title