Skip to content

Commit 1313153

Browse files
committed
Merge branch 'master' of github.com:squidfunk/mkdocs-material
2 parents 529b873 + f15e4ab commit 1313153

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/reference/meta-tags.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ extra:
8585
8686
## Customization
8787
88+
### Displaying the metadata
89+
90+
Sometimes it's useful to be able to display the medatada in the page body, e.g.
91+
print the name of the page author at the bottom of the page. To achieve that,
92+
you can [extend the theme][7] by adding the following contents to `main.html`:
93+
94+
``` html
95+
{% extends "base.html" %}
96+
97+
{% block content %}
98+
{{ super() }}
99+
{% if page and page.meta and page.meta.author %}
100+
<p><small>Author: {{ page.meta.author }}</small></p>
101+
{% endif %}
102+
{% endblock %}
103+
```
104+
105+
[7]: ../customization.md#extending-the-theme
106+
88107
### Custom meta tags
89108

90109
#### on all pages
@@ -99,7 +118,6 @@ policies for search engines:
99118
{% endblock %}
100119
```
101120

102-
[7]: ../customization.md#extending-the-theme
103121
[8]: ../customization.md#overriding-blocks-recommended
104122

105123
#### on a single page

0 commit comments

Comments
 (0)