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/ -
lang— BCP 47 language tag for the content, such askoorja. Announced on the root element, where screen readers take pronunciation from it and translation tools decide what to offer. It also picks the language the interface itself speaks, and the format dates are written in. Defaults toen, so a wiki written in another language should set it. -
strings— replacements for individual interface strings, for a language with no translation yet or a wording you disagree with. Anything left out keeps its translated value.strings: { search: 'Suchen…', onThisPage: 'Auf dieser Seite' }The keys are those of
Stringsinlib/i18n/strings.ts. -
baseUrl— used for canonical URLs, the sitemap, and Open Graph tags. Set it before you publish; social previews androbots.txtdepend on it. -
repoUrl— source repository, linked from the sidebar. Omit it and no link is rendered, so a wiki with no public source shows no dead control. -
editBranch— branch the edit links point at. Defaults tomain; set it if the repository's default branch is called something else, or every edit link leads to a branch that does not exist. -
editUrl— the shape of an edit link, with{path}where the file goes:https://git.example.com/wiki/-/edit/main/content/{path}. Only needed for a forge that cannot be identified fromrepoUrl— github.com and gitlab.com produce a link without 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