docs(v2): Add documentation for docs multi-instance support (#3978)

* Add documentation for docs multi-instance support

* Add documentation for docs multi-instance support
This commit is contained in:
Sébastien Lorber 2020-12-30 19:41:42 +01:00 committed by GitHub
parent cf086abe20
commit d5d6e2fba2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 236 additions and 8 deletions

View file

@ -78,9 +78,11 @@ module.exports = {
## Multi-instance plugins and plugin ids
It is possible to use multiple times the same plugin, on the same Docusaurus website.
All Docusaurus content plugins can support multiple plugin instances.
In this case, it is required to assign a unique id to each plugin instance.
The Docs plugin has [additional multi-instance documentation](./guides/docs/docs-multi-instance.mdx)
It is required to assign a unique id to each plugin instance.
By default, the plugin id is `default`.
@ -105,6 +107,12 @@ module.exports = {
};
```
:::note
At most one plugin instance can be the "default plugin instance", by omitting the `id` attribute, or using `id: 'default'`.
:::
## Plugins design
Docusaurus' implementation of the plugins system provides us with a convenient way to hook into the website's lifecycle to modify what goes on during development/build, which involves (but not limited to) extending the webpack config, modifying the data being loaded and creating new components to be used in a page.