Skip to content

Commit b0179e4

Browse files
cielQingWei-Li
authored andcommitted
Updated sidebar documentation to clarify nesting (#626)
The documentation for how to create nested sidebars was unclear, and I could not find it anywhere else. After experimenting, I discovered the tactic and felt it should be in the docs.
1 parent c6eafa3 commit b0179e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/more-pages.md

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ Create the `_sidebar.md`:
5151

5252
You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
5353

54+
## Nested Sidebars
55+
56+
You may want the sidebar to update with only navigation to reflect the current directory. This can be done by adding a `_sidebar.md` file to each folder.
57+
5458
`_sidebar.md` is loaded from each level directory. If the current directory doesn't have `_sidebar.md`, it will fall back to the parent directory. If, for example, the current path is `/guide/quick-start`, the `_sidebar.md` will be loaded from `/guide/_sidebar.md`.
5559

5660
You can specify `alias` to avoid unnecessary fallback.
@@ -66,6 +70,8 @@ You can specify `alias` to avoid unnecessary fallback.
6670
</script>
6771
```
6872

73+
!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
74+
6975
## Table of Contents
7076

7177
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.

0 commit comments

Comments
 (0)