mirror of
https://github.com/trycua/lume.git
synced 2026-01-06 12:29:56 -06:00
Redirect instead of 404'ing on root route
This commit is contained in:
@@ -5,7 +5,7 @@ import {
|
||||
DocsDescription,
|
||||
DocsTitle,
|
||||
} from 'fumadocs-ui/page';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { notFound, redirect } from 'next/navigation';
|
||||
import { createRelativeLink } from 'fumadocs-ui/mdx';
|
||||
import { getMDXComponents } from '@/mdx-components';
|
||||
|
||||
@@ -14,7 +14,7 @@ export default async function Page(props: {
|
||||
}) {
|
||||
const params = await props.params;
|
||||
const page = source.getPage(params.slug);
|
||||
if (!page) notFound();
|
||||
if (!page) redirect('/home');
|
||||
|
||||
const MDXContent = page.data.body;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user