feat(v2): ability to add/override theme html metadatas (#3406)

* ability to add/override theme html metadatas
see https://github.com/facebook/docusaurus/issues/3024

* refactor/fix validateThemeConfig tests
This commit is contained in:
Sébastien Lorber 2020-09-04 16:36:56 +02:00 committed by GitHub
parent f49d8baf2f
commit 21852948ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 72 additions and 29 deletions

View file

@ -85,6 +85,20 @@ module.exports = {
};
```
### Metadatas
You can configure additional html metadatas (and override existing ones).
```js {4-6} title="docusaurus.config.js"
module.exports = {
// ...
themeConfig: {
metadatas: [{name: 'twitter:card', content: 'summary'}],
// ...
},
};
```
### Announcement bar
Sometimes you want to announce something in your website. Just for such a case, you can add an announcement bar. This is a non-fixed and optionally dismissable panel above the navbar.

View file

@ -228,6 +228,7 @@ module.exports = {
darkTheme: require('prism-react-renderer/themes/dracula'),
},
image: 'img/docusaurus-soc.png',
// metadatas: [{name: 'twitter:card', content: 'summary'}],
gtag: {
trackingID: 'UA-141789564-1',
},