mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Merge pull request #2996 from vedranmiletic/master
Documented the displaying of metadata in page body
This commit is contained in:
commit
f15e4abe79
@ -85,6 +85,25 @@ extra:
|
||||
|
||||
## Customization
|
||||
|
||||
### Displaying the metadata
|
||||
|
||||
Sometimes it's useful to be able to display the medatada in the page body, e.g.
|
||||
print the name of the page author at the bottom of the page. To achieve that,
|
||||
you can [extend the theme][7] by adding the following contents to `main.html`:
|
||||
|
||||
``` html
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
{{ super() }}
|
||||
{% if page and page.meta and page.meta.author %}
|
||||
<p><small>Author: {{ page.meta.author }}</small></p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
```
|
||||
|
||||
[7]: ../customization.md#extending-the-theme
|
||||
|
||||
### Custom meta tags
|
||||
|
||||
#### on all pages
|
||||
@ -99,7 +118,6 @@ policies for search engines:
|
||||
{% endblock %}
|
||||
```
|
||||
|
||||
[7]: ../customization.md#extending-the-theme
|
||||
[8]: ../customization.md#overriding-blocks-recommended
|
||||
|
||||
#### on a single page
|
||||
|
Loading…
Reference in New Issue
Block a user