Two-Way Markdown & Git Sync
For AI coding agents: start with /start.md (build playbook) and /rules.md (compiler rules), see /llms.txt for the complete documentation index, or read this page as Markdown at /md/docs/integrations/markdown-sync.md.
Synchronize Markdown/JSON files in Git with WordPress collections and taxonomies.
Configuring sync
Add a sync glob to any collection(), wp.posts.extend(), taxonomy(), product(), or table():
export const docs = collection({
title: text(),
slug: slug({ source: "title" }),
content: richText().optional(),
}, {
hierarchical: true,
url: "/docs/:path",
sync: "content/docs/**/*.md",
});
A ** folder pattern maps subdirectories into parent/child hierarchy (index.md represents the folder item). Every synced record receives an immutable uid so renames and slug changes stay linked.
Running sync & CI workflows
- Run
typedpress syncto perform a 3-way merge between local Markdown files and WordPress. Front matter is validated against your TypeScript schema before writing. - Run
typedpress init --githubto scaffold GitHub Actions for automated content sync. - Configure
typedpress git-dispatchso edits saved inside WordPress Admin trigger a repository dispatch event automatically. - Enable
seed: trueindefineConfig()to populate synced records when a fresh deployment activates the plugin without overwriting existing editorial changes.