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.
| Property | Value |
|---|---|
| Id | docusaurus:pages:3.10 |
| Title | Docusaurus pages front matter v3.10 |
| Dialect | Draft 2020-12 |
| Required fields | None |
| Additional properties | Allowed (additionalProperties: true) |
| Reference kind | builtin |
| On by default | No |
| Upstream reference | Pages front matter |
| JSON | docusaurus-pages/3.10.json |
Use it
Section titled “Use it”Standalone pages live under src/pages, so the schema reaches them through an
override rather than the site-wide schemas: list:
meta: overrides: - files: "src/pages/**" schemas: - docusaurus:pages:3.10For a one-off run, pass the id directly:
manni meta validate src/pages/ -s docusaurus:pages:3.10Wire them up shows the pages root beside the docs and blog roots, each declared as a collection.
Fields
Section titled “Fields”| Field | Type | Constraint |
|---|---|---|
title | string | may be empty |
description | string | may be empty |
keywords | array of string | n/a |
image | string | uri-reference |
slug | string | n/a |
wrapperClassName | string | n/a |
hide_table_of_contents | boolean | n/a |
draft | boolean | not both with unlisted |
unlisted | boolean | not 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.
Additional properties
Section titled “Additional properties”Allowed. Docusaurus tolerates theme and plugin front matter, and so does this schema.
Example page
Section titled “Example page”Every field the pages plugin documents, at a legal value. This is
test/fixtures/docusaurus/pages-valid.md, and it passes.
---title: About Acmedescription: Who we are and what we build.keywords: - about - companyimage: /img/social/about.pngslug: /aboutwrapperClassName: about-pagehide_table_of_contents: truedraft: falseunlisted: false---A common mistake
Section titled “A common mistake”wrapperClassName is a CSS class name, so a boolean is wrong:
---title: About AcmewrapperClassName: 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 errorGive it the class name the page’s wrapper element should carry.