Skip to content

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#

typescript
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#

FieldPurpose
titleSite title, shown in the browser tab
descriptionSite description, used for SEO and as a fallback

Behaviour#

typescript
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 under content/ are discovered and added to the sidebar without being listed. See Navigation Configuration.

Presentation and SEO#

typescript
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 in public/

  • lang — BCP 47 language tag for the content, such as ko or ja. 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 to en, 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.

    typescript
    strings: { search: 'Suchen…', onThisPage: 'Auf dieser Seite' }

    The keys are those of Strings in lib/i18n/strings.ts.

  • baseUrl — used for canonical URLs, the sitemap, and Open Graph tags. Set it before you publish; social previews and robots.txt depend 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 to main; 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 from repoUrl — github.com and gitlab.com produce a link without it.

Individual pages override the title, description, and OG image through their Frontmatter.

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#

typescript
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:

bash
npm run validate:payload

It 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#

typescript
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#

Connected to 9 pages

Payload ConfigurationQuick StartURL StrategiesWelcome to eziwikiFrontmatterInstallationNavigation ConfigurationTheme CustomizationYour First WikiValidation & Testing