Installation
Install payload-markdown-docs and register the Payload plugin.
Installation
Install both the docs workflow package and the Markdown content package:
1pnpm add @valkyrianlabs/payload-markdown-docs @valkyrianlabs/payload-markdown
payload-markdown-docs depends conceptually on payload-markdown for Markdown fields and rendering. It does not duplicate the renderer.
Minimal Plugin Registration
1import { payloadMarkdownDocs } from '@valkyrianlabs/payload-markdown-docs'2import { buildConfig } from 'payload'3 4export default buildConfig({5 plugins: [6 payloadMarkdownDocs({7 enabled: true,8 }),9 ],10})
An enabled plugin registers the default docs infrastructure:
docs-setsdocs-groupsdocs-keysdocs-trusteddocsdocs-sync-runsdocs-sync-nonces
Recommended Server Config
1payloadMarkdownDocs({2 auth: {3 githubOidc: true,4 },5 6 target: {7 enableDrafts: true,8 },9 10 sync: {11 allowWrites: true,12 allowPublish: true,13 allowHardDelete: false,14 deleteBehavior: 'archive',15 },16})
Create a docs set in Payload Admin for each docs package. The docs set slug is
the sync source. Routes are derived from the optional group and slug. GitHub trust
and Ed25519 keys live in Docs Globals > Trusted and Docs Globals > Keys.
mode: "sync" requests are rejected unless the server has sync.allowWrites: true. Publish requests are rejected unless sync.allowPublish: true and drafts are enabled for the dedicated docs collection.
Next, create keys with keygen, then follow the quick start.
