Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JonathanSchndr/vitepress-plugin-auto-sidebar
:zap: Generate the VitePress sidebar through the folder structure
https://github.com/JonathanSchndr/vitepress-plugin-auto-sidebar
plugin sidebar vitepress
Last synced: 17 days ago
JSON representation
:zap: Generate the VitePress sidebar through the folder structure
- Host: GitHub
- URL: https://github.com/JonathanSchndr/vitepress-plugin-auto-sidebar
- Owner: JonathanSchndr
- License: mit
- Created: 2022-09-15T05:23:47.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-03T18:40:18.000Z (8 months ago)
- Last Synced: 2024-07-25T07:05:58.437Z (4 months ago)
- Topics: plugin, sidebar, vitepress
- Language: TypeScript
- Homepage:
- Size: 315 KB
- Stars: 34
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-vitepress-v1 - vitepress-plugin-auto-sidebar - Generate the sidebar through the folder structure (:electric_plug: Plugins / Community Plugins)
README
![VitePress Plugin: Auto Sidebar](./banner.jpg)
# :zap: VitePress Plugin: Auto Sidebar
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![License][license-src]][license-href]> Generate the VitePress sidebar through the folder structure.
- [✨ Release Notes](https://github.com/JonathanSchndr/vitepress-plugin-auto-sidebar/releases)
## Features
- Small library
- TypeScript Support## Setup
```sh
yarn add vitepress-plugin-auto-sidebar # yarn
npm i vitepress-plugin-auto-sidebar # npm
```## Basic usage
.vitepress/config.js
```javascript
import { getSidebar } from 'vitepress-plugin-auto-sidebar'export default {
themeConfig: {
sidebar: getSidebar({ contentRoot: '/', contentDirs: ['team'], collapsible: true, collapsed: true })
}
}
```## Options
* contentRoot – Default: '/'
> String Root of your VitePress Docs
* contentDirs – Default: ['/']
> Array of indexable contentRoot dirs, if you want to include separately. Accepts `string[]` or `{ path: string, title?: string }[]`
* collapsible – Default: true
> Boolean whether the first level can be unfolded
* collapsed – Default: true
> Boolean whether the first level items are already expanded after loading
* useFrontmatter - Default: false
> Boolean whether use front-matter for title of items**Tips:** If you want to ignore a file, name the `.md` file with an underscore (`_`).
## License
Copyright (c) 2022 Jonathan Schneider
[MIT License](./LICENSE)[npm-version-src]: https://img.shields.io/npm/v/vitepress-plugin-auto-sidebar/latest.svg
[npm-version-href]: https://npmjs.com/package/vitepress-plugin-auto-sidebar
[npm-downloads-src]: https://img.shields.io/npm/dt/vitepress-plugin-auto-sidebar.svg
[npm-downloads-href]: https://npmjs.com/package/vitepress-plugin-auto-sidebar
[license-src]: https://img.shields.io/npm/l/vitepress-plugin-auto-sidebar.svg
[license-href]: https://npmjs.com/package/vitepress-plugin-auto-sidebar