mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added web app manifest documentation
This commit is contained in:
parent
8bc24aa03e
commit
fb4d556168
@ -9,7 +9,7 @@ template: overrides/main.html
|
|||||||
### Metadata
|
### Metadata
|
||||||
|
|
||||||
The [Metadata][1] extension, which is part of the standard Markdown library,
|
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`:
|
`mkdocs.yml`:
|
||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
@ -17,29 +17,18 @@ markdown_extensions:
|
|||||||
- meta
|
- 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
|
[1]: https://github.com/squidfunk/mkdocs-material/blob/master/src/base.html
|
||||||
|
[2]: https://jekyllrb.com/docs/front-matter/
|
||||||
|
|
||||||
## Usage
|
## 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
|
### 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
|
``` 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
|
for MkDocs which appends the site title using a dash as a separator to the page
|
||||||
title.
|
title.
|
||||||
|
|
||||||
|
[3]: metadata
|
||||||
|
|
||||||
### Setting the page description
|
### 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
|
``` 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
|
This will set the `meta` tag containing the site description inside the
|
||||||
document `head` for the current page to the provided value.
|
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/
|
||||||
|
Loading…
Reference in New Issue
Block a user