Fix broken links (Devin)#5449
Conversation
Investigation: all 3 broken links are fern-platform
|
| URL | zh HTML | zh .md |
EN HTML | In sitemap-zh.xml? |
|---|---|---|---|---|
/learn/zh/cli-generator/get-started/overview |
404 | 200 | 200 | no |
/learn/zh/docs/preview-publish/multi-source-docs |
404 | 200 | 200 | no |
/learn/zh/docs/seo/robots-txt |
404 | 200 | 200 | no |
Why source has nothing to fix
- I grepped the entire
fern/tree for each path. Zero references. - The
cli-generatorproduct doesn't exist infern/docs.ymlat all — that content lives in another repo publishing to the samebuildwithfern.com/learndomain (multi-source). There's no docs-repo source for me to edit even if I wanted to. - The English equivalents serve 200 and the source links pointing at them are correct.
- The hreflang alternate is generated server-side in the fern-platform docs bundle for every English page, independent of whether a zh-locale HTML route exists for that page.
This is a second sub-bug, distinct from the stale-S3-blob sub-bug that caused /products/sdks/custom-code.mdx in #5409:
- Stale zh translation S3 blob (previously:
/sdks/deep-dives/readmeshowing the old/products/sdks/custom-code.mdxlink). FDRregisterTranslationkeeps an old blob even after successful Publish Docs runs. hreflang="zh"emitted for pages with no rendered zh HTML route (this run)..mdcontent serves 200, only the HTML page 404s, so the alternate link points at a real-but-broken URL.
Sub-bug (2) will keep producing new broken-link reports every time an English page is added or renamed without a corresponding zh translation snapshot (cli-generator, preview-publish/multi-source-docs, seo/robots-txt are all relatively recent additions). It's whack-a-mole at the lychee-config layer.
Options (none of which I'll execute without sign-off)
- Land lychee excludes anyway — matches the precedent set by #5375. Stops the noise now. Downside: you closed chore: exclude platform-side stale zh URLs from link checker #5409 which did the same thing, so I'm assuming you no longer want this.
- Fix in
fern-api/fern-platform— gatehreflang="zh"emission on actual zh route existence (sub-bug 2); investigate stale FDRregisterTranslationwrites (sub-bug 1). This is the real fix. I can open a fern-platform PR for sub-bug (2) — the docs bundle already knows which pages have translations because it buildssitemap-zh.xmlfrom that same data; the hreflang emitter is just not consulting it. - Close this PR without action — same outcome as chore: exclude platform-side stale zh URLs from link checker #5409, accept the link-checker noise as a forcing function for the platform fix.
- Drop the workflow's link-extraction on English pages, only check sitemap URLs directly — broader change to
.github/workflows/check-links.ymlto pass--no-progress --files-from urls.txtwithout letting lychee follow HTML-discovered links. Loses some legitimate external-link coverage from page bodies.
Leaning toward option 2 (open a fern-platform PR to fix the hreflang emission) since that's the root cause, but want to confirm before doing more work that gets closed. cc @davidkonigsberg
Investigation: no source-file fix applies — needs platform/manual validationAll three broken URLs are
Why this looks like a stale Full Route Cache, not a docs bugThe fern-platform docs bundle's That matches what we see:
What I changed in this PR
Asks for manual validation
Happy to open a follow-up PR with a |
|
🌿 Preview your docs: https://fern-preview-devin-fix-broken-links.docs.buildwithfern.com/learn |
|
Verified on the CI preview deploy: all three URLs return Production still 404s on those same paths, which matches the stale Full Route Cache theory above — a fresh deploy serves them correctly. The PR diff (scaffold deletion only) is the safe minimum here; the underlying fix needs to happen at the platform level (cache invalidation for newly-added slugs). |
@devin-ai-integration Please fix the broken links detected by the scheduled link checker.
Instructions:
fern docs devlocally to verify your changes don't break anythingBroken Links:
Non-429 Broken Links
View workflow run