# @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar

> 自动生成 vitepress 导航栏和侧边栏

Latest version **1.0.0** (published 2022-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
pnpm add @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
yarn add @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
bun add @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-12-10 |
| First published | 2022-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.6.0 |
| Dependencies | 0 |
| Unpacked size | 18.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | liuliang@w3ctech.com |
| Maintainers | liuliangsir, ginny315 |
| Keywords | vitepress |

## Links

- npm: https://www.npmjs.com/package/@w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
- Repository: https://github.com/w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
- Homepage: https://github.com/w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar/blob/main/README.md
- Issues: https://github.com/w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar/issues
- npm.io page: https://npm.io/package/@w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2022-12-10
- 1.0.0-beta.0 (beta) — 2022-12-10

## README

# @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar

vitepress 自动生成导航栏以及边栏

## Feature

- 支持功能
  - [x] 自动生成 nav 和 sidebar 配置
  - [x] TypeScript 支持
  - [x] 目录/文件前缀设置，默认为「📂」/「✏️」，目录前缀也可能会有「📜」
  - [x] 目录/文件的过滤

## Usage

### 安装插件

```bash
pnpm add --save-dev|-D @w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar
```

### 在 `vitepress` 配置中使用插件，示例如下

```js
import AutoConfigureNavSidebarPlugin from '@w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar'

const { nav, sidebar } = AutoConfigureNavSidebarPlugin({
  collapsed: true,
  isCollapse: true,
  showNavIcon: false,
  singleLayerNav: true,
  showSidebarIcon: true,
  ignoreFolders: ['.vuepress'],
})

module.exports = {
  themeConfig: {
    nav,
    sidebar,
  },
}
```

## Options

| 属性                      | 类型     | 默认值 | 描述                                                                   |
| ------------------------- | -------- | ------ | ---------------------------------------------------------------------- |
| entry                     | String   | 'docs' | 设置相对于项目根目录的检索入口                                         |
| singleLayerNav            | Boolean  | false  | 是否设置单层 nav                                                       |
| showTopLevelIndexUnderNav | Boolean  | false  | 是否在 nav 展示 index                                                  |
| showSidebarIcon           | Boolean  | false  | 显示 sidebar 修饰                                                      |
| showNavIcon               | Boolean  | true   | 显示 nav 修饰                                                          |
| isCollapsible             | Boolean  | true   | sidebar 是否可折叠                                                     |
| ignoreFolders             | String[] | []     | 需要排除的一些目录                                                     |
| ignoreFiles               | String[] | []     | 需要排除的一些文件                                                     |
| filePrefix                | String   | ✏️     | 文件前缀修饰，有助于区分                                               |
| dirPrefix                 | String   | 📂     | 目录前缀修饰，有助于区分                                               |
| collapsed                 | Boolean  | false  | sidebar 默认不折叠                                                     |
| customParentFolderName    | String   | ''     | 自定义侧边栏父文件夹的显示文本，不设置或为空还是默认显示原父文件夹名   |
| customIndexFileName       | String   | ''     | 自定义侧边栏 index.md 文件的显示文本，不设置或为空还是默认显示原文件名 |

---
_Source: https://npm.io/package/@w3ctech-editorial-department/vitepress-auto-configure-nav-sidebar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
