diff --git a/frontend/src/app/[lang]/docs/layout.tsx b/frontend/src/app/[lang]/docs/layout.tsx index 988d1ff71..f63d6ae7b 100644 --- a/frontend/src/app/[lang]/docs/layout.tsx +++ b/frontend/src/app/[lang]/docs/layout.tsx @@ -1,13 +1,12 @@ import type { PageMapItem } from "nextra"; import { getPageMap } from "nextra/page-map"; -import { Footer, Layout } from "nextra-theme-docs"; +import { Layout } from "nextra-theme-docs"; +import { Footer } from "@/components/landing/footer"; import { Header } from "@/components/landing/header"; import { getLocaleByLang } from "@/core/i18n/locale"; import "nextra-theme-docs/style.css"; -const footer = ; - const i18n = [ { locale: "en", name: "English" }, { locale: "zh", name: "中文" }, @@ -15,7 +14,7 @@ const i18n = [ function formatPageRoute(base: string, items: PageMapItem[]): PageMapItem[] { return items.map((item) => { - if ("route" in item) { + if ("route" in item && !item.route.startsWith(base)) { item.route = `${base}${item.route}`; } if ("children" in item && item.children) { @@ -29,6 +28,7 @@ export default async function DocLayout({ children, params }) { const { lang } = await params; const locale = getLocaleByLang(lang); const pages = await getPageMap(`/${lang}`); + const pageMap = formatPageRoute(`/${lang}/docs`, pages); return ( } - pageMap={formatPageRoute(`/${lang}/docs`, pages)} - docsRepositoryBase="https://github.com/bytedance/deerflow/tree/main/frontend/src/app/content" - footer={footer} + pageMap={pageMap} + docsRepositoryBase="https://github.com/bytedance/deerflow/tree/main/frontend/src/content" + footer={