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
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
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',
}
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' },
],
}
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' },
}
NavItem
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' },
]
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',
},
]
OpenAPIConfig
Configuration for OpenAPI spec integration.