Skip to content

fix(docs): strip .mdx extensions from generated docs links - #562

Draft
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785354565-strip-mdx-docs-links
Draft

fix(docs): strip .mdx extensions from generated docs links#562
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1785354565-strip-mdx-docs-links

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Every cross-reference in the generated docs 404s on the docs site. Speakeasy emits relative links that keep the file extension:

| `x_open_router_metadata` | [Optional[components.MetadataLevel]](../../components/metadatalevel.mdx) | ...

Mintlify serves pages at extensionless paths, so the rendered href
/docs/client-sdks/python/components/metadatalevel.mdx returns 404 while the same path without .mdx returns 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#barfoo#bar) across docs/**/*.mdx. Bash + grep + sed only, idempotent, and --check reports offending files without editing.
  • Ran it, hence the bulk one-line-per-link diff.
  • Wired it into docs-nav.yaml next to the existing gen-docs-nav.sh step, 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 from docs/sdks/** to docs/** since the broken links also live under docs/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

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author
Original prompt from dennis.jeong

SYSTEM:
=== BEGIN THREAD HISTORY (in #intern-idennis) ===
<most_recent_message>
Dennis Jeong (U0BGFCRCNP5): @Devin why are the request type links broken on <https://openrouter.ai/docs/client-sdks/typescript/sdks/chat/README`#`send|https://openrouter.ai/docs/client-sdks/typescript/sdks/chat/README`#`send>
</most_recent_message>
=== END THREAD HISTORY ===

Thread URL: https://openrouter.slack.com/archives/C0BHJFDGA1K/p1785354046874429?thread_ts=1785354046.874429&amp;cid=C0BHJFDGA1K

The latest message is the one right above that tagged you. The <most_recent_message> is the message that you should use to guide your goals + task for this session, and you should use the rest of the slack thread as context.

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant