fix(docs): strip .mdx extensions from generated docs links - #562
fix(docs): strip .mdx extensions from generated docs links#562devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Original prompt from dennis.jeong
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Summary
Every cross-reference in the generated docs 404s on the docs site. Speakeasy emits relative links that keep the file extension:
Mintlify serves pages at extensionless paths, so the rendered href
/docs/client-sdks/python/components/metadatalevel.mdxreturns 404 while the same path without.mdxreturns 200. That affected 1,568 links across 648 files — i.e. the type links on every operation page, e.g. https://openrouter.ai/docs/client-sdks/python/sdks/chat/README#send.Changes:
scripts/fix-docs-links.sh— post-generation pass that rewrites](<path>.mdx)→](<path>)(anchors preserved:foo.mdx#bar→foo#bar) acrossdocs/**/*.mdx. Bash + grep + sed only, idempotent, and--checkreports offending files without editing.docs-nav.yamlnext to the existinggen-docs-nav.shstep, so the auto-commit job fixes the links on any docs PR — including the nightly Speakeasy regen PR, which re-adds the extensions every run. Its path filter widens fromdocs/sdks/**todocs/**since the broken links also live underdocs/models,docs/components, etc.Companion PRs, identical fix: OpenRouterTeam/typescript-sdk#718 and OpenRouterTeam/go-sdk.
Link to Devin session: https://openrouter.devinenterprise.com/sessions/089016a2301f4a0183722a39a840e2f2