Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions apps/site/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import { source } from '@/lib/source';
import { notFound } from 'next/navigation';
import type { Metadata } from 'next';

export const dynamicParams = true;
export const dynamic = 'force-dynamic';
export const dynamicParams = false;

export function generateStaticParams() {
return source.generateParams();
}

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>;
}): Promise<Metadata> {
try {
const params = await props.params;
const page = source.getPage(params.slug);

if (!page) {
return {};
}

return {
title: page.data.title || 'Documentation',
description: page.data.description || undefined,
};
} catch (error) {
console.error('Error in generateMetadata:', error);
return {};
}
}

export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
Expand All @@ -16,6 +41,9 @@ export default async function Page(props: {
return (
<div className="container mx-auto px-4 py-8 max-w-4xl">
<h1 className="text-3xl font-bold mb-4">{page.data.title || 'Untitled'}</h1>
{page.data.description && (
<p className="text-lg text-gray-600 mb-6">{page.data.description}</p>
)}
<div className="prose prose-gray max-w-none">
{MDX && <MDX />}
</div>
Expand Down
8 changes: 8 additions & 0 deletions apps/site/content/docs/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": "Documentation",
"pages": [
"index",
"guide",
"spec"
]
}
2 changes: 1 addition & 1 deletion apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fumadocs-mdx": "^14.2.5",
"fumadocs-ui": "^15.0.0",
"lucide-react": "^0.344.0",
"next": "^15.1.6",
"next": "^15.3.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"zod": "^4.3.5"
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.