YAML/TOC-driven hierarchy import for Nested Docs (like Quarto _quarto.yml)
#16388
czargab18
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Feature request: YAML/TOC-driven hierarchy import for Nested Docs (like Quarto
_quarto.yml)Context / Problem
I’m using
@payloadcms/plugin-nested-docsto manage hierarchical content (parent/child + breadcrumbs) for documentation-like pages.Today, the hierarchy is typically created by manually setting the
parentrelationship for each document in the Admin UI (or by writing custom scripts). This becomes painful for large documentation sites (50–500+ pages), and it’s hard to review hierarchy changes via Git history.Many documentation tools (e.g. Quarto, MkDocs, Sphinx) solve this by allowing a single, version-controlled YAML file to define the navigation/structure (TOC). Example: Quarto’s
_quarto.ymlcan define the sidebar order and nesting.Proposal (high-level)
Add an optional YAML-driven hierarchy import/sync mechanism for nested documents. The goal: define the doc tree in one file, and have Payload automatically apply it as
parentrelationships (and optionally ordering) in the configured collections.This could be implemented as either:
@payloadcms/plugin-nested-docsitself, orPractical example (YAML summary)
Example file:
docs/_summary.ymlExpected structure in Payload:
Meaning (data-level):
pages:guidesis parent ofpages:installationandpages:configurationbreadcrumbsupdate accordingly for all descendantsDesired behavior
Apply relationships from YAML
parentlinks (core requirement)Matching strategy
id, orslug, ormatchBySafety checks / ergonomics
Optional: export
_summary.ymlfrom currentparenttreeWhere would this run?
Possible implementations (any one would help a lot):
Option A — CLI command (preferred for CI/CD)
Example:
payload nested-docs:sync --file docs/_summary.yml --dry-runpayload nested-docs:sync --file docs/_summary.yml --applyBenefits:
Option B — Utility using Local API (documented / recommended)
Provide an official script example (or helper function) that:
parentOption C — Admin-only endpoint (less preferred)
Why this should be first-party
parent,breadcrumbs, cascading updates).Related references
Open questions for maintainers
@payloadcms/plugin-nested-docs, or as a separate companion package (e.g.@payloadcms/plugin-docs-toc) that depends on nested-docs?Beta Was this translation helpful? Give feedback.
All reactions