Commit Graph

4 Commits

Author SHA1 Message Date
Guoguo
1e109fdc1b ci(links): check notebook markdown cells and video/audio sources
The image link check only looked at markdown and <img> tags, so two kinds
of references were never verified:

- MaixPy3 docs are Jupyter notebooks (.ipynb). The GIF->WebP conversion
  updated the markdown pages but not the notebooks, and the check did not
  notice.
- <video>/<source>/<audio> src and poster attributes.

Both kinds of breakage stay invisible on the live site because the COS
bucket still serves files that were removed from the repo.

Notebooks that are not valid JSON are reported on stderr instead of being
skipped silently. Also drop the two baseline entries fixed by #1048.
2026-10-13 16:18:34 +08:00
zepan
5ad7a1a59e fix(docs): resolve cross-tree and case-only ambiguities; ignore commented-out refs
- Lichee-RV 文档在 docs/soft/Lichee/zh/,素材却在 docs/hardware/zh/lichee/
  assets/RV/,中英各存一份。按页面语言消歧(两份 md5 相同),2 处
- BiT.png / Bit.png 仅大小写不同、内容相同,取与引用大小写一致的那份。
  注意它写在 <img src> 里而非 markdown ![](),替换要覆盖两种写法
- 检查器补剥离 HTML 注释:被 <!-- --> 包住的引用根本不渲染,
  算断链是误报(sipeed_longan_logo.jpg 即此例)

断链 50 -> 39。剩下 37 处是文件在整个仓库都不存在,自动规则已无能为力。
2026-10-07 21:14:31 +08:00
zepan
66300f5dd7 fix(tools): resolve site-absolute image paths the way teedoc does
构建产物核验发现检查器有 3 个误报,成因是绝对路径解析不全:

- /news/... 由 blog 插件发布,site_config 的 route 里没有登记
- 不匹配任何路由的绝对路径,teedoc 是按「该文档所属路由的根」解析,
  而不是站点根。例如 /assets/x.jpg 出现在 docs/soft/maixpy/en/ 的
  页面里,实际指向 docs/soft/maixpy/assets/x.jpg

补上这两条回退后,断链 121 -> 118,基线同步更新。
拿构建产物复核:118 项里 112 项在生成的网站里确实取不到。
2026-10-07 20:41:00 +08:00
zepan
2821a421bc ci: check that referenced images exist; document shallow clone
断链图片一直在悄悄累积(本次清理前有 230 处),而且线上看不出来:
teedoc-upload 只上传不删除对象存储里已移除的文件,旧副本把断链盖住了,
所以页面看起来正常。CI 里也从来没有任何链接检查。

- tools/check_image_links.py:只认 markdown ![]() 与 <img src>,
  先剥离代码块以免把 `convert in.jpg out.jpg` 这类示例当成引用,
  并按 site_config 的 route 解析站点绝对路径。
- tools/known_broken_images.txt:当前仍存在的 121 处已知断链基线。
  CI 对不在基线中的断链报错,基线只许减不许增。
- .github/workflows/check_links.yml:push 与 PR 均运行。
- README:建议 --depth=1 浅克隆并解释原因——文档站的历史里保留了
  每张图的所有旧版本(约 1GB),而贡献者只需要当前版本。
2026-10-07 01:01:33 +08:00