Getting paths to use with generateStaticParams
We provide a simple helper function so you can easily get all the document paths for a specific collection. This is helpful to feed the array of slugs needed for Next.js to statically generate dynamic routes.
export async function generateStaticParams() {
const posts = getDocumentSlugs('posts')
return posts.map((slug) => ({ slug }))
}