fix:change docs url (#5307)

This commit is contained in:
dreamer6680
2025-07-24 13:00:27 +08:00
committed by GitHub
parent 8e61029505
commit fa60f546d4
80 changed files with 285 additions and 94 deletions

View File

@@ -0,0 +1,5 @@
import { redirect } from 'next/navigation';
export default function HomePage() {
redirect(`/docs/introduction`);
}

View File

@@ -1,6 +1,7 @@
import { source } from '@/lib/source';
import { DocsPage, DocsBody, DocsDescription, DocsTitle } from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import NotFound from '@/components/docs/not-found';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import { getMDXComponents } from '@/mdx-components';
@@ -11,7 +12,11 @@ export default async function Page({
}) {
const { lang, slug } = await params;
const page = source.getPage(slug, lang);
if (!page || !page.data || !page.file) notFound();
// 如果页面不存在,调用 notFound()
if (!page || !page.data || !page.file) {
return <NotFound />;
}
const MDXContent = page.data.body;