@@ -2,8 +2,8 @@ import { notFound, redirect } from 'next/navigation';
22import type { FC } from 'react' ;
33
44import provideReleaseData from '#site/next-data/providers/releaseData' ;
5+ import provideReleaseVersions from '#site/next-data/providers/releaseVersions' ;
56import { ENABLE_STATIC_EXPORT } from '#site/next.constants.mjs' ;
6- import { ARCHIVE_DYNAMIC_ROUTES } from '#site/next.dynamic.constants.mjs' ;
77import * as basePage from '#site/next.dynamic.page.mjs' ;
88import { defaultLocale } from '#site/next.locales.mjs' ;
99import type { DynamicParams } from '#site/types' ;
@@ -29,7 +29,9 @@ export const generateStaticParams = async () => {
2929 return [ ] ;
3030 }
3131
32- return ARCHIVE_DYNAMIC_ROUTES . map ( version => ( {
32+ const versions = await provideReleaseVersions ( ) ;
33+
34+ return versions . map ( version => ( {
3335 locale : defaultLocale . code ,
3436 version,
3537 } ) ) ;
@@ -53,8 +55,10 @@ const getPage: FC<PageParams> = async props => {
5355 redirect ( `/${ locale } /download/archive/${ release ?. versionWithPrefix } ` ) ;
5456 }
5557
58+ const versions = await provideReleaseVersions ( ) ;
59+
5660 // Verifies if the current route is a dynamic route
57- const isDynamicRoute = ARCHIVE_DYNAMIC_ROUTES . some ( r => r . includes ( pathname ) ) ;
61+ const isDynamicRoute = versions . some ( r => r . includes ( pathname ) ) ;
5862
5963 // Gets the Markdown content and context for Download Archive pages
6064 const [ content , context ] = await basePage . getMarkdownContext ( {
0 commit comments