1
0
Fork 0

Merge pull request #5054 from freesewing/joost

fix(org): Get design list from hook
This commit is contained in:
Joost De Cock 2023-09-30 18:51:55 +02:00 committed by GitHub
commit 7bf47552a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,7 @@
// Dependencies
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
import { nsMerge } from 'shared/utils.mjs'
import { designList } from 'shared/config/designs.mjs'
import { collection } from 'site/hooks/use-design.mjs'
import { siteConfig } from 'site/site.config.mjs'
// Hooks
import { useTranslation } from 'next-i18next'
@ -53,7 +53,7 @@ export async function getStaticProps({ locale, params }) {
* To learn more, see: https://nextjs.org/docs/basic-features/data-fetching
*/
export async function getStaticPaths() {
const enPaths = [...designList].map((design) => `/designs/${design}`)
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}`))