Payload Configuration
payload/config.ts holds your site's metadata, URL behaviour, and theme. It is
deliberately small β pages come from the filesystem, not from here.
Minimum viable config
import { Payload } from '@/lib/payload/types';
export const payload: Payload = {
global: {
title: 'My Wiki',
description: 'My personal knowledge base',
},
};
export default payload;That is a complete, working site. Everything else is optional.
global
Required
| Field | Purpose |
|---|---|
title | Site title, shown in the browser tab |
description | Site description, used for SEO and as a fallback |
Behaviour
global: {
urlStrategy: 'path', // 'path' | 'hash' β default 'path'
autoNavigation: true, // boolean β default true
}urlStrategyβ whether URLs mirror the content tree or are hashed. See URL Strategies.autoNavigationβ whether pages undercontent/are discovered and added to the sidebar without being listed. See Navigation Configuration.
Presentation and SEO
global: {
favicon: '/favicon.svg',
baseUrl: 'https://mywiki.com',
seo: {
openGraph: {
title: 'My Wiki β Knowledge Base',
description: 'My personal knowledge base',
images: [{ url: '/og-image.png', width: 1200, height: 630, alt: 'My Wiki' }],
},
twitter: {
card: 'summary_large_image',
site: '@myhandle',
},
},
}faviconβ path to a file inpublic/baseUrlβ used for canonical URLs, the sitemap, and Open Graph tags. Set it before you publish; social previews androbots.txtdepend on it.
Individual pages override the title, description, and OG image through their Frontmatter.
navigation
Optional. Omit it and the sidebar is built from content/. Provide it to
control naming and ordering β see Navigation Configuration for the full picture.
theme
theme: {
primary: '#2563eb', // Links and accents
secondary: '#7c3aed', // Secondary accent
background: '#ffffff', // Page background
text: '#1f2937', // Body text
sidebarBg: '#f9fafb', // Sidebar background
codeBg: '#f3f4f6', // Inline code background
}Every field is optional and falls back to the default palette. Colours must be six-digit hex. See Theme Customization.
Validation
The config is checked against a JSON Schema before every build:
npm run validate:payloadIt catches missing required fields, malformed colours, and an invalid
urlStrategy. It runs automatically as the first step of npm run build, so a
broken config fails immediately rather than partway through rendering.
Environment variables
global: {
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000',
}The config is ordinary TypeScript, so anything available at build time works.
Types
Payload is fully typed, so your editor will autocomplete fields, flag typos,
and show the documentation for each option inline. If a field is not in the
type, it is not a real option.
Next
- Navigation Configuration β how the sidebar is assembled
- Theme Customization β colours and appearance
- Frontmatter β per-page settings