Skip to content

Commit

Permalink
chore(docs): skip static page generation for reference docs on previe…
Browse files Browse the repository at this point in the history
…w builds
  • Loading branch information
gregnr committed Sep 19, 2023
1 parent 11b7103 commit abbb109
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/docs/lib/mdx/handleRefStaticPaths.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import { ICommonSection } from '~/components/reference/Reference.types'

async function handleRefGetStaticPaths(sections: ICommonSection[]) {
// In preview environments, don't generate static pages (faster builds)
if (process.env.SKIP_BUILD_STATIC_GENERATION) {
return {
paths: [],
fallback: 'blocking',
}
}

// In production, generate static pages for every sub-section (better SEO)
return {
paths: sections.map((section) => {
return {
Expand Down

0 comments on commit abbb109

Please sign in to comment.