Skip to content

Conversation

@owenwahlgren
Copy link
Contributor

The Edit on GitHub button was generating incorrect URLs for pages served from index.mdx files. The old code used page.url to reconstruct the file path by appending .mdx, but this doesn't work for index files.

Changed to use page.path which contains the actual file path relative to the collection root, correctly handling both regular .mdx files and index.mdx files.

Example fix for /docs/tooling/avalanche-sdk:

  • Before: .../content/docs/tooling/avalanche-sdk.mdx (404)
  • After: .../content/docs/tooling/avalanche-sdk/index.mdx (correct)

🔺 Generated by DevRel swarm

The Edit on GitHub button was generating incorrect URLs for pages
served from index.mdx files. The old code used page.url to reconstruct
the file path by appending .mdx, but this doesn't work for index files.

Changed to use page.path which contains the actual file path relative
to the collection root, correctly handling both regular .mdx files and
index.mdx files.

Example fix for /docs/tooling/avalanche-sdk:
- Before: .../content/docs/tooling/avalanche-sdk.mdx (404)
- After:  .../content/docs/tooling/avalanche-sdk/index.mdx (correct)

🔺 Generated by DevRel swarm
@vercel
Copy link

vercel bot commented Dec 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
builder-hub Ready Ready Preview, Comment Dec 15, 2025 8:48pm

@0xstt 0xstt merged commit e96ab67 into master Dec 15, 2025
2 checks passed
@0xstt 0xstt deleted the fix/edit-on-github-index-mdx branch December 15, 2025 20:56
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.

3 participants