From fb4d556168237c24a124c2bfdd5d7b52c2b69b5a Mon Sep 17 00:00:00 2001 From: squidfunk Date: Mon, 27 Jul 2020 13:50:31 +0200 Subject: [PATCH] Added web app manifest documentation --- docs/reference/meta-tags.md | 41 ++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/docs/reference/meta-tags.md b/docs/reference/meta-tags.md index ea7ca8f12..1e5d600ef 100644 --- a/docs/reference/meta-tags.md +++ b/docs/reference/meta-tags.md @@ -9,7 +9,7 @@ template: overrides/main.html ### Metadata The [Metadata][1] extension, which is part of the standard Markdown library, -adds the ability to add front matter to a document and can be enabled via +adds the ability to add [front matter][2] to a document and can be enabled via `mkdocs.yml`: ``` yaml @@ -17,29 +17,18 @@ markdown_extensions: - meta ``` +Front matter is written as a series of key-value pairs at the beginning of the +Markdown document, delimited by a blank line which ends the YAML context. + [1]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html + [2]: https://jekyllrb.com/docs/front-matter/ ## Usage -Front matter is written as a series of key-value pairs at the beginning of the -Markdown document, delimited by a blank line which ends the YAML context. -Naturally, front matter is stripped from the document before rendering the -actual page content and made available to the theme: - -``` markdown ---- -title: Lorem ipsum dolor sit amet -description: Nullam urna elit, malesuada eget finibus ut, ac tortor. ---- - -# Headline - -... -``` - ### Setting the page title -The page title can be overridden on a per-document basis: +If the [Metadata][3] extension is enabled, the page title can be overridden on +a per-document basis with custom front matter: ``` markdown --- @@ -52,9 +41,12 @@ to the provided value. It will also override the default behavior of Material for MkDocs which appends the site title using a dash as a separator to the page title. + [3]: metadata + ### Setting the page description -The page description can also be overridden on a per-document basis: +If the [Metadata][3] extension is enabled, the page description can also be +overridden on a per-document basis with custom front matter: ``` markdown --- @@ -64,3 +56,14 @@ description: Nullam urna elit, malesuada eget finibus ut, ac tortor. This will set the `meta` tag containing the site description inside the document `head` for the current page to the provided value. + +### Adding a web app manifest + +A [web app manifest][4] is a simple JSON file that specifies how your web application should behave when installed on the user's mobile device or desktop, which can be set via `mkdocs.yml`: + +``` yaml +extra: + manifest: manifest.webmanifest +``` + + [4]: https://developers.google.com/web/fundamentals/web-app-manifest/