Skip to content

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

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#718
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
Contributor

Summary

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

| `request` | [operations.SendChatCompletionRequestRequest](../../models/operations/sendchatcompletionrequestrequest.mdx) | ...

Mintlify serves pages at extensionless paths, so the rendered href
/docs/client-sdks/typescript/models/operations/sendchatcompletionrequestrequest.mdx returns 404 while the same path without .mdx returns 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#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 in next to the existing scripts/gen-docs-nav.sh step in speakeasy_run_on_pr.yaml, and added a docs-nav.yaml workflow (mirroring the one python-sdk/go-sdk already have) so the nightly sdk_generation.yaml regen 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

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

Copy link
Copy Markdown
Contributor 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
Contributor 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