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
### 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
theme][7] and [override the `extrahead` block][8] to add the respective `meta`
tags to the template:
``` html
{% block extrahead %}
<meta property="robots" content="noindex, nofollow" />
{% endblock %}
```
Some further examples, including [Open Graph][1] and [Twitter Cards][9]:
=== "Open Graph"
``` html
{% block extrahead %}
@ -102,14 +110,7 @@ tags to the template:
{% endblock %}
```
[7]: ../customization.md#extending-the-theme
[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:
=== "Twitter Cards"
``` html
{% block extrahead %}
@ -128,8 +129,6 @@ of your tweet:
{% endblock %}
```
You should also [check the preview][11] of your Twitter Card.
[9]: https://twitter.com
[10]: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards
[11]: https://cards-dev.twitter.com/validator
[7]: ../customization.md#extending-the-theme
[8]: ../customization.md#overriding-blocks
[9]: https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/abouts-cards