Skip to content

Commit

Permalink
Add documentation for docs multi-instance support
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Dec 30, 2020
1 parent 9722ffd commit 9af0fa9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion website/docs/guides/docs/docs-multi-instance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Use multiple docs plugin instances on a single Docusaurus site.
slug: /docs-multi-instance
---

The `@docusaurus/plugin-content-docs` plugin can support [multi-instance](../../using-plugins#multi-instance-plugins-and-plugin-ids).
The `@docusaurus/plugin-content-docs` plugin can support [multi-instance](../../using-plugins.md#multi-instance-plugins-and-plugin-ids).

:::note

Expand Down
14 changes: 11 additions & 3 deletions website/docs/using-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ 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)

By default, the plugin id is `default`. At most one plugin can omit the id and use this default value.
It is required to assign a unique id to each plugin instance.

By default, the plugin id is `default`.

```js {6,13} title="docusaurus.config.js"
module.exports = {
Expand All @@ -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.
Expand Down

0 comments on commit 9af0fa9

Please sign in to comment.