diff --git a/.gitignore b/.gitignore index d2f884e6b6..f71c2855b6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .DS_Store .vscode +.idea *.code-workspace node_modules diff --git a/docs/guides-navigation.md b/docs/guides-navigation.md index 5a7ba736e5..7859abe3f2 100644 --- a/docs/guides-navigation.md +++ b/docs/guides-navigation.md @@ -72,6 +72,28 @@ Or you can create a new category within the sidebar: } ``` +However, for a document located in a docs subdirectory like below: + +```bash +docs +└── dir1 + └── getting-started.md +``` + +You should provide `directory/id` instead of `id` in `sidebars.json`. + +```js +{ + "docs": { + "My New Sidebar Category": [ + "dir1/getting-started" + ], + ... + }, + ... +} +``` + ### Adding New Sidebars You can also put a document in a new sidebar. In the following example, we are creating an `examples-sidebar` sidebar within `sidebars.json` that has a category called `My Example Category` containing a document with an `id` of `my-examples`. diff --git a/website/versioned_docs/version-1.2.0/guides-navigation.md b/website/versioned_docs/version-1.2.0/guides-navigation.md index e7661739e3..952a2e065d 100644 --- a/website/versioned_docs/version-1.2.0/guides-navigation.md +++ b/website/versioned_docs/version-1.2.0/guides-navigation.md @@ -73,6 +73,28 @@ Or you can create a new category within the sidebar: } ``` +However, for a document located in a docs subdirectory like below: + +```bash +docs +└── dir1 + └── getting-started.md +``` + +You should provide `directory/id` instead of `id` in `sidebars.json`. + +```js +{ + "docs": { + "My New Sidebar Category": [ + "dir1/getting-started" + ], + ... + }, + ... +} +``` + ### Adding New Sidebars You can also put a document in a new sidebar. In the following example, we are creating an `examples-sidebar` sidebar within `sidebars.json` that has a category called `My Example Category` containing a document with an `id` of `my-examples`.