diff --git a/sites/org/pages/account/[platform].mjs b/sites/org/pages/account/[platform].mjs index b57a4f2252c..9d67821699a 100644 --- a/sites/org/pages/account/[platform].mjs +++ b/sites/org/pages/account/[platform].mjs @@ -52,3 +52,31 @@ export async function getStaticProps({ locale, params }) { }, } } + +/* + * getStaticPaths() is used to specify for which routes (think URLs) + * this page should be used to generate the result. + * + * On this page, it is returning a truncated list of routes (think URLs) for all + * the mdx blog (markdown) content. + * That list comes from prebuild/blog-paths.mjs, which is built in the prebuild step + * and contains paths, titles, imageUrls, and intro for all blog posts. + * + * the fallback: 'blocking' property means that + * any pages that haven't been pre-generated + * will generate and cache the first time someone visits them + * + * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching + */ +export const getStaticPaths = async () => { + const paths = [] + for (const platform of Object.keys(freeSewingConfig.account.fields.identities).filter( + (key) => key !== 'github' + )) { + for (const locale of siteConfig.languages) { + paths.push({ params: { platform }, locale }) + } + } + + return { paths, fallback: false } +} diff --git a/sites/org/pages/account/bookmarks/[id].mjs b/sites/org/pages/account/bookmarks/[id].mjs index b51ab9b2606..0fbaca365e9 100644 --- a/sites/org/pages/account/bookmarks/[id].mjs +++ b/sites/org/pages/account/bookmarks/[id].mjs @@ -78,3 +78,10 @@ export async function getStaticProps({ locale, params }) { }, } } + +/* + * getStaticPaths() is used to specify for which routes (think URLs) + * this page should be used to generate the result. + * To learn more, see: https://nextjs.org/docs/basic-features/data-fetching + */ +export const getStaticPaths = async () => ({ paths: [], fallback: false })