Skip to content

Take the article Markdown copy path from the page source - #44

Merged
agoudbg merged 1 commit into
mainfrom
fix/markdown-copy-path
Sep 15, 2026
Merged

agoudbg merged 1 commit into
mainfrom
fix/markdown-copy-path

Conversation

@Alice39s

Copy link
Copy Markdown
Contributor

背景

8608954 已经把副本路径的来源改成 page.file.src_uri,但前端还保留了一段按 URL 反推 .md 的兜底逻辑。同一个路径语义写在两处,容易再次走岔。

做法

  • 操作区只负责交出副本路径,前端按它拼 URL,不再自己拼 .md;非本站来源拒绝。
  • 构建期保证每个渲染页都有副本,包括没有 index.md、目录页由插件生成的目录。
  • 补一个端到端测试:构建一份带目录索引页的站点,读出每页广告的副本路径,再用预览服务器真的取一遍。

Fixes #43

@Alice39s Alice39s added bug Something isn't working ui Interface and styling work labels Sep 15, 2026
Comment thread tests/test_lifecycle.py
advertised[page.relative_to(site).as_posix()] = parser.md_paths

# The home page hides the actions on purpose; every other page advertises one copy.
assert advertised.pop("index.html") == []
@Alice39s
Alice39s force-pushed the fix/markdown-copy-path branch from 946937f to dd100b1 Compare September 15, 2026 14:29
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 15, 2026

Copy link
Copy Markdown

Deploying nmteam-support with  Cloudflare Pages  Cloudflare Pages

Latest commit: dd100b1
Status: ✅  Deploy successful!
Preview URL: https://1c21a7ed.nmbot-telegram-doc.pages.dev
Branch Preview URL: https://fix-markdown-copy-path.nmbot-telegram-doc.pages.dev

View logs

@agoudbg
agoudbg merged commit 10cce71 into main Sep 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ui Interface and styling work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants