Skip to content

Docusaurus pages schema

Built-in id: docusaurus:pages:3.10

Published at https://hawkeyexl.github.io/manni/schemas/docusaurus-pages/3.10.json. A $schema that names this URL resolves to the bundled copy, with no network call.

docusaurus:pages:3.10 checks the front matter @docusaurus/plugin-content-pages reads on a Markdown page under src/pages, as of Docusaurus 3.10. It requires no field and checks the shape of every field it describes. It is one of three Docusaurus schemas, one per content plugin. The rules the three share, and what none of them checks, live on that page.

PropertyValue
Iddocusaurus:pages:3.10
TitleDocusaurus pages front matter v3.10
DialectDraft 2020-12
Required fieldsNone
Additional propertiesAllowed (additionalProperties: true)
Reference kindbuiltin
On by defaultNo
Upstream referencePages front matter
JSONdocusaurus-pages/3.10.json

Standalone pages live under src/pages, so the schema reaches them through an override rather than the site-wide schemas: list:

manni.config.yaml
meta:
overrides:
- files: "src/pages/**"
schemas:
- docusaurus:pages:3.10

For a one-off run, pass the id directly:

Terminal window
manni meta validate src/pages/ -s docusaurus:pages:3.10

Wire them up shows the pages root beside the docs and blog roots, each declared as a collection.

FieldTypeConstraint
titlestringmay be empty
descriptionstringmay be empty
keywordsarray of stringn/a
imagestringuri-reference
slugstringn/a
wrapperClassNamestringn/a
hide_table_of_contentsbooleann/a
draftbooleannot both with unlisted
unlistedbooleannot both with draft

Standalone pages carry no sidebar, pagination, or tag metadata, which is why this set is the smallest of the three.

draft and unlisted are mutually exclusive here as in the other two schemas. The rules worth knowing covers that rule and the uri-reference typing of image.

Allowed. Docusaurus tolerates theme and plugin front matter, and so does this schema.

Every field the pages plugin documents, at a legal value. This is test/fixtures/docusaurus/pages-valid.md, and it passes.

src/pages/about.md
---
title: About Acme
description: Who we are and what we build.
keywords:
- about
- company
image: /img/social/about.png
slug: /about
wrapperClassName: about-page
hide_table_of_contents: true
draft: false
unlisted: false
---

wrapperClassName is a CSS class name, so a boolean is wrong:

test/fixtures/docusaurus/pages-bad-wrapper-class.md
---
title: About Acme
wrapperClassName: true
---
✗ test/fixtures/docusaurus/pages-bad-wrapper-class.md
/wrapperClassName must be string (line 3) [docusaurus:pages:3.10]
1 file checked, 0 passed, 1 failed, 1 error

Give it the class name the page’s wrapper element should carry.