From 5a1131177ed1e5477e2801bc7d534b9246fed828 Mon Sep 17 00:00:00 2001 From: shanyuhai123 <864299347@qq.com> Date: Tue, 29 Mar 2022 22:19:03 +0800 Subject: [PATCH] docs(gh): add removeEmptyGroup option --- .../docs/features/plugin-options.md | 14 ++++++++++++++ .../docs/zh/features/plugin-options.md | 15 +++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/packages/vuepress-docs-gh-pages/docs/features/plugin-options.md b/packages/vuepress-docs-gh-pages/docs/features/plugin-options.md index 544a2c5..8389470 100644 --- a/packages/vuepress-docs-gh-pages/docs/features/plugin-options.md +++ b/packages/vuepress-docs-gh-pages/docs/features/plugin-options.md @@ -254,6 +254,20 @@ module.exports = { If you just ignore some file, you can use the [autoIgnore](/features/markdown-file-config.html#autoignore) in the markdown file. +## removeEmptyGroup + +When you configure all files in a folder with [autoGroup](/features/markdown-file-config.html#multiple-groups), it will cause the default group to be empty, and when you want to hide it you can use: + +```js +module.exports = { + plugins: [ + "vuepress-plugin-auto-sidebar": { + removeEmptyGroup: true + } + ] +} +``` + ## nav This plugin also provides a way to generate nav. diff --git a/packages/vuepress-docs-gh-pages/docs/zh/features/plugin-options.md b/packages/vuepress-docs-gh-pages/docs/zh/features/plugin-options.md index f7de440..c6c9e72 100644 --- a/packages/vuepress-docs-gh-pages/docs/zh/features/plugin-options.md +++ b/packages/vuepress-docs-gh-pages/docs/zh/features/plugin-options.md @@ -26,6 +26,7 @@ module.exports = { uncollapseList: [] }, ignore: [], + removeEmptyGroup: false, git: { trackStatus: 'all' } @@ -257,6 +258,20 @@ module.exports = { 如果你想隐藏单个文件,那么可在文件中添加 [autoIgnore](/zh/features/markdown-file-config.html#autoignore)。 +## removeEmptyGroup(隐藏空分组) + +当你将文件夹中所有文件都配置了 [autoGroup](/zh/features/markdown-file-config.html#多个分组) 时,会导致默认分组为空,想隐藏它时可使用: + +```js +module.exports = { + plugins: [ + "vuepress-plugin-auto-sidebar": { + removeEmptyGroup: true + } + ] +} +``` + ## nav(导航栏) 为了简化你第一次搬迁博客、笔记的成本,它仅仅提供了一个简单的生成导航栏的方式。