@@ -10,7 +10,7 @@ import { dateToString } from "@/lib/utils/date"
10
10
import { getPostSlugs } from "@/lib/utils/md"
11
11
import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
12
12
13
- import { DEFAULT_LOCALE , LOCALES_CODES } from "@/lib/constants"
13
+ import { LOCALES_CODES } from "@/lib/constants"
14
14
15
15
import { componentsMapping , layoutMapping } from "@/layouts"
16
16
import { fetchGFIs } from "@/lib/api/fetchGFIs"
@@ -39,7 +39,7 @@ export default async function Page({
39
39
const { locale, slug : slugArray } = await params
40
40
41
41
// Check if this specific path is in our valid paths
42
- const validPaths = await pagesToBuild ( )
42
+ const validPaths = await generateStaticParams ( )
43
43
const isValidPath = validPaths . some (
44
44
( path ) =>
45
45
path . locale === locale && path . slug . join ( "/" ) === slugArray . join ( "/" )
@@ -106,7 +106,7 @@ export default async function Page({
106
106
)
107
107
}
108
108
109
- async function pagesToBuild ( ) {
109
+ export async function generateStaticParams ( ) {
110
110
const slugs = await getPostSlugs ( "/" )
111
111
112
112
return LOCALES_CODES . flatMap ( ( locale ) =>
@@ -117,18 +117,7 @@ async function pagesToBuild() {
117
117
)
118
118
}
119
119
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
132
121
133
122
export async function generateMetadata ( {
134
123
params,
0 commit comments