shanyuhai123 / vuepress-plugin-auto-sidebar Goto Github PK
View Code? Open in Web Editor NEWvuepress 自动生成侧边栏的插件。
Home Page: https://shanyuhai123.github.io/vuepress-plugin-auto-sidebar/
License: MIT License
vuepress 自动生成侧边栏的插件。
Home Page: https://shanyuhai123.github.io/vuepress-plugin-auto-sidebar/
License: MIT License
在vuepress2.x版本中,安装了插件
执行
vuepress nav docs
没有任何报错,也不会生成文件。
直接就执行结束了。
版本:
"vuepress": "^2.0.0-beta.19",
"vuepress-plugin-auto-sidebar": "^2.3.0"
侧边栏 可以忽略整个文件夹吗?
譬如
.
..
dir1/
dir2/
README.md
可以把 dir1 和 dir2 及其内容也显示出来?
可以加个开关,是否将README排序为第一个
用yarn docs:dev
就能生成,然后修改配置文件引入这个文件
开发者, 您好
使用您的插件在执行npm run dev
时,有以下提示, 且无法看到侧边栏, 主题未使用默认主题, 而是使用 reco .
TypeError: Cannot read property 'split' of undefined
at getMenuPath (/home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/lib/utils.js:2:46)
at /home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/index.js:18:19 at Array.map (<anonymous>)
at ready (/home/node/blogHome/node_modules/[email protected]@vuepress-plugin-auto-sidebar/index.js:16:30)
at AsyncOption.asyncApply (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/plugin-api/abstract/AsyncOption.js:33:21)
at async PluginAPI.applyAsyncOption (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/plugin-api/index.js:277:5)
at async App.process (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/node/App.js:123:5) at async dev (/home/node/blogHome/node_modules/_@[email protected]@@vuepress/core/lib/index.js:17:3)
另文件结果如下
docs
├── .vuepress
│ ├── public
│ │ └── *.png
│ ├── config.js
├── netcdf-python
│ ├── netCDF4-python.md
│ └── README.md
└── README.md
感谢
第一次运行npm run docs:dev
没有生成.vuepress/nav.js
,是什么情况
请问在vuepress创建的package.json文件中添加scripts("docs:nav": "vuepress nav docs")并且已经完成安装此插件后nav命令执行失败,该怎么解决呢?
env:
"vuepress": "^1.9.7",
"vuepress-plugin-auto-sidebar": "^2.3.2"
files under dir ./docs/
README.md
│
└─implementation
│ README.md
│
├─Module.Common
│ │ README.md
│ │ words敏感词.md
│ │
│ └─CommentAdmin
│ README.md
│
└─Theme.TheAdmin
│ ArticleService.md
│ index.md
│
└─ArticleAdmin
edit.md
index.md
D:\A\Scoop\apps\nodejs\current\node.exe D:\A\Scoop\apps\nodejs\current\node_modules\npm\bin\npm-cli.js run docs:build
> docs:build
> vuepress build docs
√ Server
Compiled successfully in 42.93s
√ Client
Compiled successfully in 51.16s
√ Server
Compiled successfully in 42.93s
Language does not exist: c#
wait Rendering static HTML...
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"
found in
---> <SidebarLinks>
<DropdownTransition>
<SidebarGroup>
<SidebarLinks>
<Sidebar>
<Layout>
<GlobalLayout>
<Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"
found in
---> <SidebarLinks>
<DropdownTransition>
<SidebarGroup>
<SidebarLinks>
<Sidebar>
<Layout>
<GlobalLayout>
<Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/ArticleAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"
found in
---> <SidebarLinks>
<DropdownTransition>
<SidebarGroup>
<SidebarLinks>
<Sidebar>
<Layout>
<GlobalLayout>
<Root>
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[vuepress] No matching page found for sidebar item "/implementation/Theme.TheAdmin/index"
[Vue warn]: Error in render: "TypeError: Cannot read properties of undefined (reading 'match')"
found in
---> <SidebarLinks>
<DropdownTransition>
<SidebarGroup>
<SidebarLinks>
<Sidebar>
<Layout>
<GlobalLayout>
<Root>
error Error rendering /implementation/Theme.TheAdmin/: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleAdmin/edit.html: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleAdmin/: false
undefined
error Error rendering /implementation/Theme.TheAdmin/ArticleService.html: false
undefined
TypeError: Cannot read properties of undefined (reading 'match')
at getHash (node_modules/@vuepress/theme-default/util/index.js:13:21)
at isActive (node_modules/@vuepress/theme-default/util/index.js:47:19)
at render (node_modules/@vuepress/theme-default/components/SidebarLink.vue:25:0)
at renderWithStyleInjection (node_modules/vue-loader/lib/runtime/componentNormalizer.js:83:0)
at createFunctionalComponent (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3071:30)
at createComponent (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3244:12)
at _createElement (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3436:15)
at createElement (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3368:10)
at vm._c (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3505:42)
at 1.server-bundle.js:1054:492
at Proxy.renderList (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:2640:16)
at Proxy.SidebarLinksvue_type_template_id_1da4684a_render (node_modules/@vuepress/theme-default/components/SidebarLinks.vue?5fd7:1:152)
at VueComponent.Vue._render (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue\dist\vue.runtime.common.dev.js:3559:22)
at resolve (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8444:27)
at waitForServerPrefetch (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8316:3)
at renderComponentInner (C:\Users\i\source\repos\inbornking.net\4.code\2.reading\node_modules\vue-server-renderer\build.dev.js:8455:3)
安装后,无法启动项目了,请问咋整
sidebar: false 似乎无效
那么为什么不简单的数值顺序呢???
具体情形是 mode
为 titlecase
情形下出错:
module.exports = {
plugins: {
"vuepress-plugin-auto-sidebar": {
title: {
// 报错
mode: "titlecase"
}
}
}
}
因为文档非常的多,所以希望分组里面再分一个组,请问可以支持这种需求吗
希望增加这样的功能
插件会默认生成全部没有被忽略的文件侧边栏配置,并不会覆盖掉已经自行配置的sidebar对象,生成的侧边栏对象默认合并自行配置的侧边栏对象。
业务场景
目前我需要指定某一文件夹内的全部页面统一使用自行配置侧边栏,但是其他的页面使用本插件来自动识别。不过目前本插件总是覆盖掉了自行配置的文件。
使用版本
"vuepress": "^1.9.5"
打包后部署到nginx,侧边栏就没了,开发环境正常
配置项里能否导出一个函数接口作为传入给sort()的排序规则呢?
like:
{
...
sortRules: function(a,b) {
return a.split('/')[0].parseInt() - b.split('/')[0].parseInt()
}
}
使用ASCII方式排序毕竟是对有自动排序需求的人来说有些鸡肋了
问题1:
老铁能否参考下面这个插件做一个自动侧边栏功能吗?不然每次新建文章,都要去sidebar中添加一下!
问题2:
貌似侧边栏文件及文件夹不识别汉字,只能英文或数字,这就导致文档很多的情况下不是很方便,希望老铁能优化一下,哈哈!
我想生成是根据markdown一级标题生成侧边栏目录结构,现在是/test/t.html,是不是还有哪些地方需要设置的
RT,请问使用插件之后生成的侧边栏为什么带.html扩展名?我的文档目录是VuePressBlog\docs\toy文件夹下有toy1.md和toy2.md,生成的侧边栏是 /toy/toy1.html和 /toy/toy2.html,是我的使用方法不对吗?=。=||
一个文件夹内的默认的分组名称如何去除,想全部都自定义分组,不然就得改文件夹名称
---
autoGroup-1: 分组名称
# autoGroup+10: 分组名称
---
通过在文件中添加分组标签虽然也可以达到分组的效果,但是太多文件被放在同一个文件夹下,查找起来很麻烦,能否通过,将文件在不同的文件夹下,通过文件夹的名称作为组名,自动生成分组的效果。
目前的情况是,如果guide下还有文件夹就不能作为左侧菜单显示,例如:
-guide
- +--linux
+-- linux.md
这样linux就无法被生成左侧的菜单。
具体就是我后创建的文件排在之前文件的上面,看了下源码没能明白你的意图,是使用的不对吗=。= 求解答=。=
"vuepress-plugin-auto-sidebar": {
titleMode: "uppercase",
sort:'asc'
},
在 vuepress(version 1.7.1) 时虽然修复了文件内容更新,但其 update 生命周期更新依然存在问题(更新一次后失效),所以插件也尚未提供该功能。
当前还需要你手动重新运行,还是期待后续的 vitepress 吧 😺 。
插件很好用,但是如果我想在文件内配置分组,不想要默认分组,好像没有配置可以更改的
Is there a way to auto create sidebar groups ?
使用过程如下
安装
yarn add -D vuepress-plugin-auto-sidebar
配置
// 在 .vuepress/config.js 中配置插件
// edit .vuepress/config.js file
module.exports = {
plugins: [
["vuepress-plugin-auto-sidebar", {}]
]
}
配置完成后显示如下
只显示当前目录下的文件
想要的效果是可以显示出zh目录下的所有的目录和文件
我测zh目录结构如下
F:\code\markdown\project\jfinal-doc\docs\zh>go-tree
.
├── 1 快速上手
│ ├── 1.0 快速上手.md
│ ├── 1.1 Maven 基础.md
│ ├── 1.10 JBolt 插件下开发.md
│ ├── 1.11 特别声明.md
│ ├── 1.2 jfinal-undertow 下开发.md
│ ├── 1.3 jfinal-undertow 下部署.md
│ ├── 1.4 jfinal-undertow 高级用法.md
│ ├── 1.5 jfinal-undertow 常见问题.md
│ ├── 1.6 jetty-server 下开发.md
│ ├── 1.7 tomcat 下部署.md
│ ├── 1.8 非 maven 方式开发.md
│ ├── 1.9 IDEA下开发.md
├── 10 Validator
│ ├── 10.1 概述.md
│ ├── 10.2 Validator.md
│ ├── 10.3 Validator配置.md
├── 11 国际化
│ ├── 11.1 概述.md
│ ├── 11.2 I18n与Res.md
│ ├── 11.3 I18nInterceptor.md
├── 12 Json 转换
│ ├── 12.1 概述.md
│ ├── 12.2 Json 配置.md
│ ├── 12.3 Json 的四个实现.md
│ ├── 12.4 Json 转换用法.md
├── 13 JFinal架构及扩展
│ ├── 13.1 概述.md
│ ├── 13.2 架构.md
├── 14 升级JFinal
│ ├── 14.1 极速升级.md
│ ├── 14.2 Ret.md
│ ├── 14.3 configEngine.md
│ ├── 14.4 baseViewPath.md
│ ├── 14.5 RenderFactory.md
│ ├── 14.6 其它.md
├── 2 JFinalConfig
│ ├── 2.1 概述.md
│ ├── 2.2 configConstant.md
│ ├── 2.3 configRoute.md
│ ├── 2.4 configEngine.md
│ ├── 2.5 configPlugin.md
│ ├── 2.6 configInterceptor.md
│ ├── 2.7 configHandler.md
│ ├── 2.8 onStart and onStop 回调配置.md
│ ├── 2.9 PropKit 读取配置.md
├── 3 Controller
│ ├── 3.1 概述.md
│ ├── 3.10 session 操作.md
│ ├── 3.11 getFile 文件上传.md
│ ├── 3.12 keep 系方法.md
│ ├── 3.2 Action.md
│ ├── 3.3 Action 参数注入.md
│ ├── 3.4 get & getPara 系列方法.md
│ ├── 3.5 getBean & getModel 系列.md
│ ├── 3.6 set & setAttr 方法.md
│ ├── 3.7 render 方法.md
│ ├── 3.8 renderFile 文件下载.md
│ ├── 3.9 renderQrCode 二维码生成.md
├── 4 AOP
│ ├── 4.1 概述.md
│ ├── 4.2 Interceptor.md
│ ├── 4.3 Before.md
│ ├── 4.4 Clear.md
│ ├── 4.5 Inject 依赖注入.md
│ ├── 4.6 Aop 工具.md
│ ├── 4.7 Routes 级别拦截器.md
│ ├── 4.8 Proxy 动态代理.md
├── 5 ActiveRecord
│ ├── 5.1 概述.md
│ ├── 5.10 表关联操作.md
│ ├── 5.11 复合主键.md
│ ├── 5.12 Oracle支持.md
│ ├── 5.13 Enjoy SQL 模板.md
│ ├── 5.14 多数据源支持.md
│ ├── 5.15 独立使用 ActiveRecord.md
│ ├── 5.16 调用存储过程.md
│ ├── 5.2 ActiveRecordPlugin.md
│ ├── 5.3 Model.md
│ ├── 5.4 生成器与 JavaBean.md
│ ├── 5.5 独创Db Record模式.md
│ ├── 5.6 paginate 分页.md
│ ├── 5.7 数据库事务处理.md
│ ├── 5.8 Cache 缓存.md
│ ├── 5.9 Dialect多数据库支持.md
├── 6 Enjoy 模板引擎
│ ├── 6.1 概述.md
│ ├── 6.10 Spring boot 整合.md
│ ├── 6.11 独立使用 Enjoy.md
│ ├── 6.2 引擎配置.md
│ ├── 6.3 表达式.md
│ ├── 6.4 指令.md
│ ├── 6.5 注释.md
│ ├── 6.6 原样输出.md
│ ├── 6.7 Shared Method 扩展.md
│ ├── 6.8 Shared Object扩展.md
│ ├── 6.9 Extension Method扩展.md
│ ├── images
├── 7 EhCachePlugin
│ ├── 7.1 概述.md
│ ├── 7.2 EhCachePlugin.md
│ ├── 7.3 CacheInterceptor.md
│ ├── 7.4 EvictInterceptor.md
│ ├── 7.5 CacheKit.md
│ ├── 7.6 ehcache.xml简介.md
├── 8 RedisPlugin
│ ├── 8.1 概述.md
│ ├── 8.2 RedisPlugin.md
│ ├── 8.3 Redis与Cache.md
│ ├── 8.4 非web环境使用RedisPlugin.md
├── 9 Cron4jPlugin
│ ├── 9.1 概述.md
│ ├── 9.2 Cron4jPlugin.md
│ ├── 9.3 使用外部配置文件.md
│ ├── 9.4 高级用法.md
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'
},
},
],
};
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:
Do you have an idea of what might be missing?
Thanks in advance,
Fares
docs目录下有个a文件夹
a文件夹下有A.md B.md README.md
启动项目 只能到README.md中 侧边栏没有目录 但是访问可以访问到A.md B.md
我是哪里做错了什么么?
"vuepress": "^2.0.0-beta.67"
"vuepress-plugin-auto-sidebar": "^2.3.2"
以上使用版本,想问是不支持v2吗还是我设置原因
文件已经被git add了,插件提示“未被 git 跟踪,无法参与有效排序”,请问是什么问题?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.