Skip to content

Commit 3961078

Browse files
committed
set dynamicParams to false
1 parent fc782dc commit 3961078

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

app/[locale]/[...slug]/page.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { dateToString } from "@/lib/utils/date"
1010
import { getPostSlugs } from "@/lib/utils/md"
1111
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
1212

13-
import { DEFAULT_LOCALE, LOCALES_CODES } from "@/lib/constants"
13+
import { LOCALES_CODES } from "@/lib/constants"
1414

1515
import { componentsMapping, layoutMapping } from "@/layouts"
1616
import { fetchGFIs } from "@/lib/api/fetchGFIs"
@@ -39,7 +39,7 @@ export default async function Page({
3939
const { locale, slug: slugArray } = await params
4040

4141
// Check if this specific path is in our valid paths
42-
const validPaths = await pagesToBuild()
42+
const validPaths = await generateStaticParams()
4343
const isValidPath = validPaths.some(
4444
(path) =>
4545
path.locale === locale && path.slug.join("/") === slugArray.join("/")
@@ -106,7 +106,7 @@ export default async function Page({
106106
)
107107
}
108108

109-
async function pagesToBuild() {
109+
export async function generateStaticParams() {
110110
const slugs = await getPostSlugs("/")
111111

112112
return LOCALES_CODES.flatMap((locale) =>
@@ -117,18 +117,7 @@ async function pagesToBuild() {
117117
)
118118
}
119119

120-
export async function generateStaticParams() {
121-
const allPages = await pagesToBuild()
122-
123-
if (process.env.IS_PREVIEW_DEPLOY === "true") {
124-
// Only build default locale
125-
return allPages.filter((page) => page.locale === DEFAULT_LOCALE)
126-
}
127-
128-
return allPages
129-
}
130-
131-
export const dynamicParams = true
120+
export const dynamicParams = false
132121

133122
export async function generateMetadata({
134123
params,

0 commit comments

Comments
 (0)