mirror of
https://github.com/rohitg00/skillkit.git
synced 2026-11-19 02:13:58 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user