1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-14 10:57:41 +01:00

Generalized meta tags documentation

This commit is contained in:
squidfunk 2020-08-10 12:50:37 +02:00
parent 889a9f03d4
commit c09e5f1cad

View File

@ -77,11 +77,19 @@ extra:
## Customization ## Customization
### Open Graph In order to add `meta` tags to your document, you can [extend the theme][7] and
simply [override the `extrahead` block][8] with the respective tags, e.g. to set
policies for search engines:
In order to add [Open Graph][1] data to your document, you can [extend the ``` html
theme][7] and [override the `extrahead` block][8] to add the respective `meta` {% block extrahead %}
tags to the template: <meta property="robots" content="noindex, nofollow" />
{% endblock %}
```
Some further examples, including [Open Graph][1] and [Twitter Cards][9]:
=== "Open Graph"
``` html ``` html
{% block extrahead %} {% block extrahead %}
@ -102,14 +110,7 @@ tags to the template:
{% endblock %} {% endblock %}
``` ```
[7]: ../customization.md#extending-the-theme === "Twitter Cards"
[8]: ../customization.md#overriding-blocks
### Twitter Cards
When you post links to your project documentation on [Twitter][9], it's
highly recommended to add [Twitter's `meta` tags][10] to optimize the preview
of your tweet:
``` html ``` html
{% block extrahead %} {% block extrahead %}
@ -128,8 +129,6 @@ of your tweet:
{% endblock %} {% endblock %}
``` ```
You should also [check the preview][11] of your Twitter Card. [7]: ../customization.md#extending-the-theme
[8]: ../customization.md#overriding-blocks
[9]: https://twitter.com [9]: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards
[10]: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards
[11]: https://cards-dev.twitter.com/validator