fix: 文档站子页面左侧目录不加载

docsify 进子目录路由会先请求 <目录>/_sidebar.md,失败(404)才回退根
目录;Cloudflare Pages 无 404.html 时对缺失路径 SPA 回退返回 index.html
且状态 200,docsify 把 HTML 当侧栏 Markdown 解析,左侧目录卡在加载中。
alias 将 docs/、examples/ 的 _sidebar.md 请求映射回根目录 _sidebar.md。
This commit is contained in:
snowy-yang committed 2026-09-24 21:51:40 +08:00
1 parent badf5b3571
commit e66148a75c
2 files changed
+6

No files matched your search

+1
View File
@@ -58,6 +58,7 @@
- token 请求失败时抛出 `TokenError`(携带 QQ 返回的 `code`/`message`),不再抛出掩盖真实原因的 `KeyError: 'access_token'` - token 请求失败时抛出 `TokenError`(携带 QQ 返回的 `code`/`message`),不再抛出掩盖真实原因的 `KeyError: 'access_token'`
- 修正被动回复 `event_id` 的指引:官方要求取网关帧最外层的 id(`Event.event_id`),事件体里的裸 UUID(`Interaction.id` 等)不能作 `event_id`,此前文档与 docstring 的说法有误 - 修正被动回复 `event_id` 的指引:官方要求取网关帧最外层的 id(`Event.event_id`),事件体里的裸 UUID(`Interaction.id` 等)不能作 `event_id`,此前文档与 docstring 的说法有误
- 响应 `Content-Type` 非 JSON 时不再抛 `ContentTypeError`(个别接口如回应互动返回 200 text/plain + `{}` body);JSON 解析统一切换 ujson - 响应 `Content-Type` 非 JSON 时不再抛 `ContentTypeError`(个别接口如回应互动返回 200 text/plain + `{}` body);JSON 解析统一切换 ujson
- 文档站点子页面左侧目录不加载:docsify 进入子目录页面会先请求 `<目录>/_sidebar.md`、请求失败才回退根目录,而 Cloudflare Pages 对缺失路径回退返回 `index.html`(状态 200),侧栏被当作 Markdown 解析成空白;`index.html` 的 alias 现将 `docs/`、`examples/` 的 `_sidebar.md` 请求映射回根目录
## [0.1.0] - 2026-09-14 ## [0.1.0] - 2026-09-14
+5
View File
@@ -50,6 +50,11 @@
alias: { alias: {
'/examples': '/examples/README.md', '/examples': '/examples/README.md',
'/examples/': '/examples/README.md', '/examples/': '/examples/README.md',
// 子目录页面的 _sidebar.md 请求映射到根目录的:
// docsify 会先请求 <当前目录>/_sidebar.md,而 Cloudflare Pages 对
// 缺失文件回退 index.html 且状态 200,docsify 误当作侧栏解析导致目录空白
'/docs/_sidebar.md': '/_sidebar.md',
'/examples/_sidebar.md': '/_sidebar.md',
}, },
plugins: [ plugins: [
// 把 ```mermaid 代码块替换为 div 后交给 mermaid 渲染(架构图/时序图) // 把 ```mermaid 代码块替换为 div 后交给 mermaid 渲染(架构图/时序图)