fix(docs): strip .mdx extensions from generated docs links - #718
fix(docs): strip .mdx extensions from generated docs links#718devin-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/typescript/models/operations/sendchatcompletionrequestrequest.mdxreturns 404 while the same path without.mdxreturns 200. That affected 1,139 links across 526 files — i.e. the type link on every operation page, e.g. https://openrouter.ai/docs/client-sdks/typescript/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.scripts/gen-docs-nav.shstep inspeakeasy_run_on_pr.yaml, and added adocs-nav.yamlworkflow (mirroring the one python-sdk/go-sdk already have) so the nightlysdk_generation.yamlregen PR — which never runs the repo's docs post-processing scripts — gets both the nav regen and the link fix auto-committed before it merges. Without that, Speakeasy re-adds the extensions on the next regen.Companion PRs, identical fix: OpenRouterTeam/python-sdk and OpenRouterTeam/go-sdk (same bug in both, e.g.
/docs/client-sdks/go/models/components/chatrequest.mdx).Link to Devin session: https://openrouter.devinenterprise.com/sessions/089016a2301f4a0183722a39a840e2f2