mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-09 15:07:55 -05:00
* added turborepo * finished turbo migration * updated gitignore * use dotenv & run format * fixed error in docs * remove standalone deployment in prod * fix ts error, remove ignore ts errors during build * added formatter to the end of the docs generator
59 lines
1.5 KiB
TypeScript
59 lines
1.5 KiB
TypeScript
import { notFound } from 'next/navigation'
|
|
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/page'
|
|
import mdxComponents from '@/components/mdx-components'
|
|
import { source } from '@/lib/source'
|
|
|
|
export const dynamic = 'force-static'
|
|
|
|
export default async function Page(props: { params: Promise<{ slug?: string[] }> }) {
|
|
const params = await props.params
|
|
const page = source.getPage(params.slug)
|
|
if (!page) notFound()
|
|
|
|
const MDX = page.data.body
|
|
|
|
return (
|
|
<DocsPage
|
|
toc={page.data.toc}
|
|
full={page.data.full}
|
|
tableOfContent={{
|
|
style: 'clerk',
|
|
enabled: true,
|
|
header: <div className="mb-2 text-sm font-medium">On this page</div>,
|
|
single: false,
|
|
}}
|
|
article={{
|
|
className: 'scroll-smooth max-sm:pb-16',
|
|
}}
|
|
tableOfContentPopover={{
|
|
style: 'clerk',
|
|
enabled: true,
|
|
}}
|
|
footer={{
|
|
enabled: false,
|
|
}}
|
|
>
|
|
<DocsTitle>{page.data.title}</DocsTitle>
|
|
<DocsDescription>{page.data.description}</DocsDescription>
|
|
<DocsBody>
|
|
<MDX components={mdxComponents} />
|
|
</DocsBody>
|
|
</DocsPage>
|
|
)
|
|
}
|
|
|
|
export async function generateStaticParams() {
|
|
return source.generateParams()
|
|
}
|
|
|
|
export async function generateMetadata(props: { params: Promise<{ slug?: string[] }> }) {
|
|
const params = await props.params
|
|
const page = source.getPage(params.slug)
|
|
if (!page) notFound()
|
|
|
|
return {
|
|
title: page.data.title,
|
|
description: page.data.description,
|
|
}
|
|
}
|