1
0
Fork 0

chore(org): Only add English to getStaticPaths

This commit is contained in:
Joost De Cock 2023-10-09 18:23:41 +02:00
parent 70676804f4
commit 8f9bb8189e
2 changed files with 2 additions and 15 deletions

View file

@ -53,14 +53,8 @@ export async function getStaticProps({ locale, params }) {
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
*/
export async function getStaticPaths() {
const enPaths = [...collection].map((design) => `/designs/${design}`)
const paths = [...enPaths]
for (const lang of siteConfig.languages.filter((lang) => lang !== 'en')) {
paths.push(...enPaths.map((path) => `/${lang}${path}`))
}
return {
paths,
paths: [...collection].map((design) => `/designs/${design}`),
fallback: 'blocking',
}
}

View file

@ -73,14 +73,7 @@ export async function getStaticPaths() {
//.filter((path) => path.split('/').length < 5)
return {
paths: [
...somePaths.map((key) => `/${key}`),
...somePaths.map((key) => `/es/${key}`),
...somePaths.map((key) => `/de/${key}`),
...somePaths.map((key) => `/fr/${key}`),
...somePaths.map((key) => `/nl/${key}`),
...somePaths.map((key) => `/uk/${key}`),
],
paths: somePaths.map((key) => `/${key}`),
fallback: false,
}
}