shanyuhai123 / vuepress-plugin-auto-sidebar

vuepress 自动生成侧边栏的插件。
https://shanyuhai123.github.io/vuepress-plugin-auto-sidebar/
MIT License
138 stars 29 forks source link

Sidebar not being generated #74

Closed FaresKi closed 2 years ago

FaresKi commented 2 years ago

Hey! First of all, thanks for the plugin. I seem to have an issue understanding how to use the plugin, because I haven't managed to implement it correctly: Here is my config:

// 
module.exports = {
  plugins: [
    'vuepress-plugin-auto-sidebar',
    {
      titleMap: {
        'core-concepts': 'Core Concepts',
        presentation: 'Presentation'
      },
    },
  ],
};

here is my project structure:

image

and this is the console log with these error messages:

> vuepress dev docs

warning an anonymous plugin or theme was detected and ignored
warning an anonymous plugin or theme was detected and ignored
info Initializing VuePress and preparing data...

  vite v2.9.14 dev server running at:

This is the what's rendered:

image

Do you have an idea of what might be missing? Thanks in advance, Fares

shanyuhai123 commented 2 years ago

your config format is incorrect, you can visit vuepress docs see more, and now titleMap was changed,

module.exports = {
  plugins: [
    ["vuepress-plugin-auto-sidebar", {
      title: {
       map: {
         '/introduction/core-concepts': 'Core Concepts',
         '/introduction/presentation': 'Presentation'
       }
      }
    }],
   // you can add other plugins below
  ]
}
FaresKi commented 2 years ago

Thanks!