Skip to content

Commit

Permalink
docs: improve structure
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa committed Nov 16, 2024
1 parent 9bbebcf commit f98c9c8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
14 changes: 5 additions & 9 deletions docs/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ import {
} from 'fumadocs-ui/page'
import { notFound } from 'next/navigation'

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

if (!page)
notFound()

Expand All @@ -29,13 +28,10 @@ export default async function Page(props: {
)
}

export async function generateStaticParams() {
return source.generateParams()
}
export const generateStaticParams = async () =>
source.generateParams()

export async function generateMetadata(props: {
params: Promise<{ slug?: string[] }>
}) {
export const generateMetadata = async (props: { params: Promise<{ slug?: string[] }> }) => {
const params = await props.params
const page = source.getPage(params.slug)
if (!page)
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"dev": "next dev --turbo",
"postinstall": "fumadocs-mdx",
"start": "next start"
},
Expand Down
4 changes: 3 additions & 1 deletion docs/source.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ export const { docs, meta } = defineDocs({
dir: 'content/docs',
})

export default defineConfig()
export default defineConfig({
// lastModifiedTime: 'git',
})

0 comments on commit f98c9c8

Please sign in to comment.