docs: mention config/sidebars run in Node.js runtime (#10608)

This commit is contained in:
Sébastien Lorber 2024-10-23 20:01:07 +02:00 committed by GitHub
parent 1a2b8b7d05
commit 35aa39bddb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 8 deletions

View file

@ -12,8 +12,8 @@ Creating a sidebar is useful to:
To use sidebars on your Docusaurus site:
1. Define a file that exports a dictionary of [sidebar objects](#sidebar-object).
2. Pass this object into the `@docusaurus/plugin-docs` plugin directly or via `@docusaurus/preset-classic`.
1. Define a sidebars file that exports a dictionary of [sidebar objects](#sidebar-object).
2. Pass its path to the `@docusaurus/plugin-docs` plugin directly or via `@docusaurus/preset-classic`.
```js title="docusaurus.config.js"
export default {
@ -31,6 +31,12 @@ export default {
};
```
:::important Node.js runtime
The sidebars file is run with Node.js. You can't use or import browsers APIs, React or JSX in it.
:::
This section serves as an overview of miscellaneous features of the doc sidebar. In the following sections, we will more systematically introduce the following concepts:
```mdx-code-block