You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(sidebar): added the expansion sidebar first level directory implementation (#371)
* feat(sidebar):Added the expansion sidebar first level directory implementation
* docs(sidebar):origin main
* docs(sidebar):Added the expansion sidebar first level directory implementation
* docs(sidebar): added the expansion sidebar first level directory implementation
Copy file name to clipboardExpand all lines: docs/pages/en/integrations/vitepress-plugin-sidebar/index.md
+112Lines changed: 112 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,3 +94,115 @@ calculateSidebar([
94
94
```
95
95
96
96
Then the first-level ignore rule will no longer be in effect, and instead `'Notes'` and `'Tweets'` will appear as directory names on pages accessed under `/`, and `'Articles'` will appear as a separate directory on pages accessed under `/articles/`.
97
+
98
+
## Optional Configuration
99
+
100
+
The above configuration enables the automatic generation of sidebars. If you wish to achieve the **automatic expansion of the top-level folder in a specified path** using the [`collapse:false` option](https://vitepress.dev/zh/reference/default-theme-sidebar#collapsible-sidebar-groups) available in the native configuration, you can further try the following setup.
101
+
102
+
### Integrate with VitePress
103
+
104
+
In the VitePress configuration file (usually `docs/.vitepress/config.ts`, the file path and extension may be different).
],''), //The base parameter should be set according to your specific configuration // [!code focus]
143
+
//...
144
+
}
145
+
}
146
+
```
147
+
148
+
::: details What is `base` ?
149
+
150
+
In the `config.ts` file, locate the line where you import the function: `import { calculateSidebar asoriginalCalculateSidebar } from"@nolebase/vitepress-plugin-sidebar";`.
151
+
152
+
Hover over `calculateSidebar`, then click to navigate to the `index.d.ts` file. You will see something like the following:
0 commit comments