Skip to content

Commit

Permalink
Update using-plugins.md
Browse files Browse the repository at this point in the history
  • Loading branch information
yangshun authored Jun 23, 2020
1 parent 433fd8b commit 6d6cc2a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions website/docs/using-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ A plugin is a module which exports a function that takes two parameters and retu

The exported modules for plugins are called with two parameters: `context` and `options` and returns a JavaScript object with defining the [lifecycle APIs](./lifecycle-apis.md).

For example if you have a reference to a local folder such as this in your docusaurus.config.js:
For example if you have a reference to a local folder such as this in your `docusaurus.config.js`:

plugins: [path.resolve(__dirname, 'my-plugin')],
```js title="docusaurus.config.js"
module.exports = {
// ...
plugins: [path.resolve(__dirname, 'my-plugin')],
};
```

Then in the folder `my-plugin` you can create an index.js such as this

Expand Down

0 comments on commit 6d6cc2a

Please sign in to comment.