/vuepress-plugin-auto-sidebar

vuepress 自动生成侧边栏的插件。

Primary LanguageTypeScriptMIT LicenseMIT

Vuepress Plugin Auto Sidebar

Vuepress Plugin Auto Sidebar npm npm

🇬🇧 English | 🇨🇳 简体中文

现在,它已经支持 VuePress V2 了。

Now, it is support VuePress V2.

介绍(Introduction)

This is a plugin that automatically generates a sidebar for vuepress.

安装(Install)

npm i vuepress-plugin-auto-sidebar -D

# v2 alpha(测试版)
npm i vuepress-plugin-auto-sidebar@alpha -D

使用(Usage)

Attention, do not put plugins in the themeConfig, how to use plugins

module.exports = {
  plugins: [
    ["vuepress-plugin-auto-sidebar", {}]
  ]
}

📖 For more detailed documentation, you can visit vuepress-plugin-auto-sidebar

1. Require

令人遗憾的事。

In VuePress v1 the above can quickly help you enable the plugin, but since VuePress v2 does not yet provide the corresponding capabilities, you need to introduce the generated sidebar.js file yourself.

const sidebarConf = require('./sidebar')

module.exports = {
  plugins: [
    ["vuepress-plugin-auto-sidebar", {}]
  ],
  themeConfig: {
    sidebar: sidebarConf
  }
}

2. Simple Navbar

We have extended vuepress cli to help you quickly generate a simple navigation bar, how to use it:

# v2 not support
vuepress nav docs