mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
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.
This commit is contained in:
parent
c6eafa32b1
commit
b0179e4c64
@ -51,6 +51,10 @@ Create the `_sidebar.md`:
|
||||
|
||||
You need to create a `.nojekyll` in `./docs` to prevent GitHub Pages from ignoring files that begin with an underscore.
|
||||
|
||||
## Nested Sidebars
|
||||
|
||||
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.
|
||||
|
||||
`_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`.
|
||||
|
||||
You can specify `alias` to avoid unnecessary fallback.
|
||||
@ -66,6 +70,8 @@ You can specify `alias` to avoid unnecessary fallback.
|
||||
</script>
|
||||
```
|
||||
|
||||
!> You can create a `README.md` file in a subdirectory to use it as the landing page for the route.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
Once you've created `_sidebar.md`, the sidebar content is automatically generated based on the headers in the markdown files.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user