Skip to content

章节首页的 Markdown 操作在生产环境仍然 404 #43

Description

@Alice39s

现象

https://support.nmteam.xyz/nmbot-telegram/ 这类章节首页上,「复制 Markdown」和菜单里的「View as Markdown」都会弹窗:

Markdown 版本在构建产物中提供。请先运行 uv run nmteam build,或使用其他打开方式。

普通文章页(如 /about/)正常。

原因

操作区用 page.url 反推副本地址,拼出 <dir>.md。目录索引页发布成 <dir>/index.html,副本写在 <dir>/index.md,请求 <dir>.md 得到 404 页面;前端看到 text/html 就当成「没有副本」。

docs/ 下有 14 个 index.md,除首页(按设计不显示操作区)外 13 个页面都会命中。

状态

  • 23:20 线上实测:/nmbot-telegram.md 404 text/html/nmbot-telegram/index.md 200 text/markdown;页面 HTML 是 data-md-url="nmbot-telegram/",JS 里还是 var path = raw ? "/" + raw.replace(/\/+$/, "") + ".md" : "/index.md";
  • main8608954 改掉了推导逻辑,Cloudflare Pages 对该提交的构建 22:24 就报了成功,但线上直到 23:37 前后才换成新资源,中间约一小时仍在提供旧构建。
  • 23:40 复查:HTML 是 data-md-url="nmbot-telegram/index.md",JS 含新的兜底逻辑,弹窗不再复现。

待办

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinguiInterface and styling work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions