Skip to content

Commit a7b0c2f

Browse files
Use fumadocs page.path for GitHub URL instead of manual construction
Fixes "Open in GitHub" linking to wrong file for index pages. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 80680c1 commit a7b0c2f

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎next-env.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/types/routes.d.ts";
3+
import "./.next/dev/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

‎src/app/[lang]/docs/[version]/[[...slug]]/page.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export default async function Page({
4444

4545
// Construct URLs for page actions
4646
const markdownUrl = `${page.url}.mdx`;
47-
const githubUrl = `https://github.com/JasonXuDeveloper/JEngine.Docs/blob/main/content/docs/${fullSlug.join('/')}${lang === 'zh' ? '.zh' : ''}.mdx`;
47+
// Use fumadocs page.path (virtualized file path relative to content dir)
48+
const githubUrl = `https://github.com/JasonXuDeveloper/JEngine.Docs/blob/main/content/docs/${page.path}`;
4849

4950
return (
5051
<DocsPage toc={data.toc} full={data.full}>

0 commit comments

Comments
 (0)