vuepress-barista
v0.2.4
Published
A function to generate a vuepress sidebar from the file system.
Downloads
26
Maintainers
Readme
vuepress-barista
A vuepress 2.x sidebar generator inspired by vuepress-bar.
Usage
.vuepress/config.ts
import { defaultTheme } from "@vuepress/theme-default";
import getConfig from "vuepress-barista";
/**
* @param path Path to directory with markdown files
* relative to vuepress' current working directory.
* Should be '.' or './' in most setups.
* @param opts Options.
*/
const { sidebar } = getConfig("./", {
stripNumbers: true,
capitalizeWords: true,
maxLevel: 2
});
export default {
title: 'VuePress 2.x Website',
description: 'Vuepress 2.x site with auto-generated sidebar',
theme: defaultTheme({ sidebar })
}
Options
| Param | Type | Default | Description |
| --------------- | ----------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
| capitalizeWords | boolean
| false | Capitalize words derived from all-lowercase directory or filenames. When false uses directory or filename spelling. |
| stripNumbers | boolean
| true | Remove number prefixes from directory names where it helps sorting. |
| maxLevel | number
| 2 | Maximum level of recursion for subdirectory traversing. |
| filter | function(i: SidebarItem): boolean
| | Filter function to filter files. |