Next.js
HomeArticleGalleryContact
AboutTermsPrivacy
Theme Selector
Outstatic
2024年8月30日

Outstatic

Outstatic is an open source CMS for static websites using Next.js.

John Doe

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 }))
}
All Posts

126 views