npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-vitepress-simple-sidebar

v1.0.1

Published

自动生成 vitepress 侧边栏目录的插件

Readme

vite-plugin-vitepress-simple-sidebar

中文文档

Note This project is no longer maintained and has been merged into this project for modifications.

vite-plugin-vitepress-simple-sidebar is a plugin designed to automatically generate sidebar configurations for VitePress projects. It reads the file and subdirectory structure in the specified directory (default to the .vitepress folder) to create a navigation sidebar, simplifying the configuration process and improving development efficiency.

Example Directory Structure

Assuming your project has the following directory structure:

.
├── .vitepress
├── component.md
├── experience
│   ├── 2024
│   │   └── makeblock-interview.md
│   └── index.md
├── index.md
├── interview
│   ├── Vue
│   │   └── test.md
│   ├── Vue3
│   │   └── index.md
│   └── index.md
├── markdown-examples.md
└── test.md

Using this plugin, the following sidebar configuration will be automatically generated:

{
  "/experience/": [
    {
      "text": "2024",
      "items": [
        {
          "text": "makeblock-interview",
          "link": "/experience/2024/makeblock-interview"
        }
      ],
      "collapsed": true
    },
    {
      "text": "index",
      "link": "/experience/index"
    }
  ],
  "/interview/": [
    {
      "text": "Vue",
      "items": [
        {
          "text": "test",
          "link": "/interview/Vue/test"
        }
      ],
      "collapsed": true
    },
    {
      "text": "Vue3",
      "items": [
        {
          "text": "index",
          "link": "/interview/Vue3/index"
        }
      ],
      "collapsed": true
    },
    {
      "text": "index",
      "link": "/interview/index"
    }
  ]
}

Installation

Install the vite-plugin-vitepress-simple-sidebar plugin in your project:

# Recommended to use pnpm
pnpm i vite-plugin-vitepress-simple-sidebar -D

# Or use npm
npm i vite-plugin-vitepress-simple-sidebar --save-dev

Configuration

In your VitePress configuration file (usually .vitepress/config.mts or .vitepress/config.ts), import and configure the plugin:

// .vitepress/config.mts
import { autoSidebar } from 'vite-plugin-vitepress-simple-sidebar'

export default defineConfig({
  vite: {
    plugins: [
      autoSidebar({
        // Custom configuration can be added here, see below for details
      }),
    ],
  },
});

Plugin Configuration Options

The autoSidebar function accepts an optional configuration object SidebarOptions to customize the sidebar generation behavior:

export interface SidebarOptions {
  includeDirs?: string[];
  excludeDirs?: string[];
  includeFiles?: string[];
  excludeFiles?: string[];
  // Additional configuration options will be added in future versions
}
  • includeDirs: Specify directories to include in sidebar generation.
  • excludeDirs: Specify directories to exclude from sidebar generation.
  • includeFiles: Specify files to include in the sidebar.
  • excludeFiles: Specify files to exclude from the sidebar.

By default, if no configuration parameters are passed, the plugin will scan the .vitepress directory and generate the corresponding sidebar configuration.

Future Plans

The vite-plugin-vitepress-simple-sidebar plugin is still under active development, with more configuration options and features to be added to meet the needs of different projects. We welcome contributions and feedback from the community to jointly create a more perfect VitePress plugin ecosystem.

translated by AI