# Docsify-Build-Sidebar **Repository Path**: zengjianjin0920/Docsify-Build-Sidebar ## Basic Information - **Project Name**: Docsify-Build-Sidebar - **Description**: github开源项目,源自https://github.com/xxxxue,地址https://github.com/xxxxue/Docsify-Build-Sidebar - **Primary Language**: C# - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-13 - **Last Updated**: 2026-01-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Docsify Build Sidebar 自动生成 docsify 的 sidebar 和 每个子目录中的 sidebar [Docsify 官网](https://github.com/docsifyjs/docsify) ## 使用方法 - 在 Github 页面右侧的 "Releases" 中下载编译好的软件 - 修改 Config 中的 `HomePath` 为 `自己电脑上的目标根目录` - 双击 exe 执行 ## 小技巧 可以右键单击 exe, 创建快捷方式, 把这个 `快捷方式` 剪切到自己的项目根目录, 以后就不用每次都去找 exe 了 ![image](https://github.com/xxxxue/Docsify-Build-Sidebar/assets/32764266/db131d3a-1caa-4ce9-a86f-a4622912d129) ``` ├─ DocsifyBuildSidebar │ ├─Config │ │ └─Config.json │ └─DocsifyBuildSidebar.exe └─ MyBlog ├─.git ├─index.html └─DocsifyBuildSidebar.exe - 快捷方式 ``` ## Config.json 配置项 | 名称 | 说明 | 例子 | | ------------------------- | ------------------------------------------- | --------------------------------------- | | HomePath | Docsify 项目的根目录 | `E:\\Work\\coding\\xxxue` | | IgnoreFile | 忽略的文件 (判断规则: 相等) | `Readme.md` | | IgnoreDir | 忽略的目录 (判断规则: 相等) | `.git` | | IgnoreDirNameContain | 忽略的目录 (判断规则: 目录名称任意位置包含) | `.assets` 匹配 `*.assets*` | | DisableGenerateReadmeFile | 禁用 "生成 Readme.md 文件" (默认生成) | `true` (不生成) / `false`(生成)(默认值) | ## 界面效果 ![image-20220501150050290](img.assets/image-20220501150050290.png) ## 生成的结果 ### 首页 ```markdown - [C_Sharp](C_Sharp/) - [test](C_Sharp/test/) - [1](C_Sharp/test/1.md) - [2](C_Sharp/test/2.md) - [Utils](C_Sharp/Utils.md) - [Java](Java/) - [Github](Java/Github.md) - [JavaScript](JavaScript/) - [test](JavaScript/test/) - [code](JavaScript/test/code.md) - [test1](JavaScript/test/test1/) - [te](JavaScript/test/test1/te.md) - [test2](JavaScript/test/test1/test2/) - [aaa](JavaScript/test/test1/test2/aaa.md) - [Docsify](JavaScript/Docsify.md) - [Github](JavaScript/Github.md) - [Ubuntu](Ubuntu/) - [Commands](Ubuntu/Commands.md) ``` ### 1 级子目录 ```markdown - [返回首页](/) - [C_Sharp](C_Sharp/) - [test](C_Sharp/test/) - [1](C_Sharp/test/1.md) - [2](C_Sharp/test/2.md) - [Utils](C_Sharp/Utils.md) ``` ### n 级子目录 ```markdown - [返回上一级 [C_Sharp]](C_Sharp/) - [test](C_Sharp/test/) - [1](C_Sharp/test/1.md) - [2](C_Sharp/test/2.md) ``` ## index.html 模版 追求稳定, 可以把 css 与 js 文件保存到本地, 防止在国内有时候 cdn 连不上 比如 同级的 `static` 目录 html 中就改为 `"static/docsify-sidebar-collapse.min.js"` ```html
``` ## 其他脚本 `安装docsify.bat` ```bat @echo off npm i docsify-cli -g ``` `运行docsify.bat` ```bat @echo off docsify serve ./ ``` `删除生成的 md 文件.ps1` ```powershell # PowerShell 递归删除指定文件 # 定义排除目录列表,支持动态添加, # 使用逗号分隔,比如: '.git', 'MoreDirName' $excludeDirs = @('.git') # 要删除的文件 Get-ChildItem -Recurse -File -Include "_sidebar.md", "README.md" | Where-Object { $path = $_.DirectoryName -not ($excludeDirs | Where-Object { $path -like "*\$_" }) } | Remove-Item -Force Pause ``` ## 交流 [https://github.com/xxxxue/sponsors](https://github.com/xxxxue/sponsors)