Skip to content

Commit

Permalink
Fix static pages generation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonswiss committed Jul 23, 2024
1 parent d46c311 commit 0230dd8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions docs/app/(site)/blog/[post]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,7 @@ export async function generateMetadata ({ params }): Promise<Metadata> {
}

// Static HTML page generation for each document page
export async function generateStaticPaths () {
export async function generateStaticParams () {
const posts = await reader.collections.posts.list()
return {
paths: posts.map((post) => ({ params: { post } })),
fallback: false,
}
return posts.map((post) => ({ post }))
}
7 changes: 2 additions & 5 deletions docs/app/(site)/docs/[...rest]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ export async function generateMetadata ({ params }) {
}

// Static HTML page generation for each document page
export async function generateStaticPaths () {
export async function generateStaticParams () {
const pages = await reader.collections.docs.list()
return {
paths: pages.map((page) => ({ params: { rest: page.split('/') } })),
fallback: false,
}
return pages.map((page) => ({ rest: page.split('/') }))
}

0 comments on commit 0230dd8

Please sign in to comment.