@geongu.park/vitepress-plugin-autosidebar
v1.0.8
Published
The auto side bar for the vitepress v2
Downloads
18
Readme
vitepress-plugin-autosidebar
Auto sidebar for vitepress v2
- The
vitepress-plugin-autosidebar
framework makes it easy to generate sidebar in vitepress v2.
Installation
Install the package using npm:
npm install @geongu.park/vitepress-plugin-autosidebar -D
Usage
const rootPath = __dirname;
const directoryPath = '';
const excludeFileName = ['README'];
const result = await getSidebar(rootPath, directoryPath, excludeFileName);
API
getSidebar(rootPath: string, directoryPath: string, excludeFileName?: string[]): Promise<{ text: string, link: string }[]>
Parameters
rootPath
(required): The root path of the directory.directoryPath
(required): The directory path from the root path.excludeFileName
(optional): An array of file names to exclude from the sidebar (default: ['index']).
Returns
a promise that resolves to an array of sidebar items. Each item has a text property representing the file name without the extension and a link property representing the file path.
License
This project is licensed under the MIT License.
Support
If you encounter any issues or have any questions, feel free to open an issue in the issue tracker.
Author
geongu.park