vite-plugin-vitepress-auto-nav
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

vite-plugin-vitepress-auto-nav

中文文档

Auto-generate VitePress nav and sidebar configurations.

✨ Features

  • Use primary folder as nav and secondary folder and files as sidebar
  • Automatic refresh after changing plugin configuration or frontmatter.
  • Support for customizing read ranges (based on srcDir and srcExclude configurations).
  • Support to customize whether the index.md under the sub-folder is displayed separately or by clicking the folder name.
  • Support for customizing the display name, articles also support the first level of the title as the name.
  • Support for customizing the sorting method
  • Support for customizing hidden files or folders
  • Supports both plugin options and article frontmatter configurations to customize article configurations (configured attribute names also support adding prefixes).
  • Support for using the same Gitbook SUMMARY.md file as the sidebar configuration.

🕯️ Usage

  1. Install
# Installing vite is recommended when using ts, otherwise you will get type errors.
pnpm i vite-plugin-vitepress-auto-nav vite -D
  1. Add the plugin
// .vitepress/config.ts
import AutoNav from “vite-plugin-vitepress-auto-nav”;

export default defineConfig({
  vite: {
    plugins: [
      AutoNav({
        // Custom configurations
      })
    ]
  }
});
  1. Start the project normally and it's ready to use

Configuration

Please refer to the TypeScript type hints

License

MIT License © 2023 Xaviw

Package Sidebar

Install

npm i vite-plugin-vitepress-auto-nav

Weekly Downloads

32

Version

3.0.0

License

MIT

Unpacked Size

19.1 kB

Total Files

9

Last publish

Collaborators

  • xaviw