fix: resolve /docs 404 and show docs link on mobile

- Handle undefined slug by defaulting to empty array for index page
- Remove hidden class from Docs link so it shows on mobile
This commit is contained in:
Rohit Ghumare
2026-01-28 17:36:06 +00:00
parent f0b59b3e39
commit 58bd0bbdd4
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ export default function HomeLayout({
<div className="flex items-center gap-2 sm:gap-4">
<Link
href="/docs"
className="text-zinc-400 hover:text-white transition-colors text-sm font-mono hidden sm:block"
className="text-zinc-400 hover:text-white transition-colors text-sm font-mono"
>
Docs
</Link>
@@ -10,7 +10,7 @@ interface PageProps {
export default async function Page(props: PageProps) {
const params = await props.params
const page = source.getPage(params.slug)
const page = source.getPage(params.slug ?? [])
if (!page) notFound()
const MDX = page.data.body
@@ -32,7 +32,7 @@ export async function generateStaticParams() {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params
const page = source.getPage(params.slug)
const page = source.getPage(params.slug ?? [])
if (!page) notFound()
return {