1.0.10 • Published 5 years ago

vue-sidebar-generator v1.0.10

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Vuepress sidebar generator

This package reads folders in your workdir with a README.md file and appends it to your sidebar

Getting started

npm i vue-sidebar-generator
or
yarn add vue-sidebar-generator

In config.js

let Sidebar = require("vue-sidebar-generator")

const init = () => {
    let sidebar = Sidebar.autoSidebar(); // default path is "./"

    return {
        // rest of config options
        sidebar: {
            "/": sidebar
        },
        //config options
    }
}
module.exports = init();

support for folders - netlify

const init = () => {
    const path = "./docs"
    const sidebar = Sidebar.folderToSidebar(path)

    return {
        // rest of config options
        sidebar: [
          {
            title: "",
            collapsable: false,
            children: sidebar
          }
        ],
        //config options
    }
}
module.exports = init();

this will read all the markdown files in that folder and append to sidebar.

read sidebar from YAML front matter in README.md

there is also an option to select which items to have in your sidebar. You can specify in README.md for workdir

---\ title: title\ sidebar: sideItem1, sideItem2, sideItem3\ ---

then in config.js

let sidebar = getSidebar();

Folder structure

project
|___.vuepress
|   |   config.js
|
|___post1
|   |   README.md
|
|___post2
|   |   README.md
|
|___post3
|   |   README.md
|
|   package.json
|   README.md
|

currently subfolders are not supported.

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago