MkDocs Material schema
Built-in id: mkdocs:material:9.7
Published at https://hawkeyexl.github.io/manni/schemas/mkdocs-material/9.7.json.
A $schema that names this URL resolves to the bundled copy, with no network
call.
mkdocs:material:9.7 checks the front matter MkDocs 1.6 and Material for MkDocs
9.7 read from a .md page. It requires nothing, because MkDocs builds a page
with no front matter at all. It is one of the platform
schemas, which say what a generator
accepts rather than what your team agreed.
| Property | Value |
|---|---|
| Id | mkdocs:material:9.7 |
| Title | MkDocs Material front matter v9.7 |
| Files it fits | .md |
| Dialect | Draft 2020-12 |
| Required fields | None |
| Additional properties | Allowed (additionalProperties: true) |
| Reference kind | builtin |
| On by default | No |
| Upstream reference | Meta-data and Material reference |
| JSON | mkdocs-material/9.7.json |
Use it
Section titled “Use it”MkDocs keeps everything under docs_dir, so one override covers the site:
meta: overrides: - files: "docs/**" schemas: - mkdocs:material:9.7For a one-off run, pass the id directly:
manni meta validate docs/ -s mkdocs:material:9.7Fields
Section titled “Fields”The two keys MkDocs itself defines, plus the seventeen Material for MkDocs adds
on top of them. Material is the theme the overwhelming majority of MkDocs sites
run. It is where nearly all of the front matter surface lives. Core MkDocs reads
title and template and nothing else. So one id covers both, the way
vitepress:page:1.6 covers VitePress and its default theme in one.
| Field | Type | Notes |
|---|---|---|
title | string | MkDocs. Fourth of four title sources, so never required. |
template | string | MkDocs. The theme template rendering this page. |
description | string | The <meta name="description">, and the social card’s text. |
author | string | The <meta name="author">. One name, not a list. |
icon | string | An icon shortcode, resolved as .icons/<value>.svg. |
status | string | new and deprecated ship; others come from theme.extra.status. |
subtitle | string | Rendered under the navigation entry. Material 9.6 and later. |
hide | string array | navigation, toc, path, tags, footer, feedback. |
tags | string array | Read by the tags plugin and added to the search index. |
search | object | exclude and boost. |
social | object | cards, cards_layout, cards_layout_options. |
date | date | object | A post’s date, or a mapping requiring created. |
authors, categories | string array | A post’s authors and categories. |
draft, pin | boolean | Hold a post back; pin it to the top of a view. |
readtime | integer | Overrides the computed reading time, in minutes. |
slug | string | Overrides a post’s URL segment. |
links | array | A post’s sidebar links, in nav shape. |
hide is the field this schema exists for. Material decides what to hide by
testing membership of the list, with "navigation" in page.meta.hide. It says
nothing at all about an entry it does not recognise, so hide: [sidebar] builds
cleanly and hides nothing. The six values are transcribed from the templates
that test them, not from a documentation page, so the list is what the theme
actually honours.
The rest of the value is in the typing. readtime, draft and pin go through
the blog plugin’s own configuration validation, which refuses a quoted number or
a quoted boolean outright. tags reaches a search plugin that checks
isinstance(tags, list) and skips a bare string without a word. boost is
copied into the search index exactly as written, so a quoted one ranks nothing.
Additional properties
Section titled “Additional properties”Allowed. A key neither MkDocs nor Material defines passes unchecked.
Versioning
Section titled “Versioning”Example page
Section titled “Example page”A page carrying the Material page keys, at legal values. This is
test/fixtures/platform/mkdocs-valid.md, and it passes.
---title: Configuring the cachedescription: How the build cache works and when to clear it.author: Docs teamicon: material/cachedstatus: newsubtitle: Build performancetemplate: reference.htmlhide: - navigation - toc - path - tags - footer - feedbacktags: - caching - performancesearch: boost: 2 exclude: falsesocial: cards: true cards_layout: default cards_layout_options: background_color: "#4051b5" title: Cache---A common mistake
Section titled “A common mistake”sidebar is not a value any Material template tests for, so it hides nothing.
The build succeeds, and the schema reports the entry:
---title: Release noteshide: - sidebar---✗ test/fixtures/platform/mkdocs-bad-hide.md /hide/0 must be equal to one of the allowed values (line 4) [mkdocs:material:9.7]
1 file checked, 0 passed, 1 failed, 1 errorUse navigation to hide the navigation sidebar, or toc to hide the table of
contents.