11'use strict' ;
22
3- import provideReleaseData from '#site/next-data/providers/releaseData' ;
43import { blogData } from '#site/next.json.mjs' ;
54
65import { provideBlogPosts } from './next-data/providers/blogData' ;
6+ import provideReleaseVersions from './next-data/providers/releaseVersions' ;
77import { BASE_PATH , BASE_URL } from './next.constants.mjs' ;
88import { siteConfig } from './next.json.mjs' ;
99import { defaultLocale } from './next.locales.mjs' ;
@@ -20,8 +20,6 @@ export const IGNORED_ROUTES = [
2020 locale !== defaultLocale . code && / ^ b l o g / . test ( pathname ) ,
2121 // This is used to ignore all pathnames that are empty
2222 ( { locale, pathname } ) => locale . length && ! pathname . length ,
23- // This is used to ignore download routes for Node.js versions and downloads archive page
24- ( { pathname } ) => / ^ d o w n l o a d \/ ( v \d + ( \. \d + ) * | a r c h i v e ) $ / . test ( pathname ) ,
2523] ;
2624
2725/**
@@ -33,13 +31,11 @@ export const IGNORED_ROUTES = [
3331 */
3432export const DYNAMIC_ROUTES = new Map ( [
3533 // Creates dynamic routes for downloads archive pages for each version
36- // (e.g., /download/v18.20.8, /download/v20.19.2)
37- ...provideReleaseData ( )
38- . flatMap ( ( { minorVersions, versionWithPrefix } ) => [
39- `download/${ versionWithPrefix } ` ,
40- ...minorVersions . map ( minor => `download/${ minor . versionWithPrefix } ` ) ,
41- ] )
42- . map ( version => [ version , 'download-archive' ] ) ,
34+ // (e.g., /download/archive/v18.20.8, /download/archive/v20.19.2)
35+ ...provideReleaseVersions ( ) . map ( version => [
36+ `download/archive/${ version } ` ,
37+ 'download-archive' ,
38+ ] ) ,
4339 // Provides Routes for all Blog Categories
4440 ...blogData . categories . map ( c => [ `blog/${ c } ` , 'blog-category' ] ) ,
4541 // Provides Routes for all Blog Categories w/ Pagination
@@ -55,6 +51,18 @@ export const DYNAMIC_ROUTES = new Map([
5551 . flat ( ) ,
5652] ) ;
5753
54+ /**
55+ * A Map that stores file paths for Markdown files to be dynamically generated
56+ * in a dynamic route, keyed by their corresponding layout names.
57+ *
58+ * @type {Map<import('./types').Layouts, Array<string>> } A Map of Layout Name and paths
59+ */
60+ export const DYNAMIC_MARKDOWN_ROUTES = new Map ( [
61+ // Pages that use the download-archive layout map to the /{locale}/download/archive/index.mdx
62+ // markdown file.
63+ [ 'download-archive' , [ 'download' , 'archive' ] ] ,
64+ ] ) ;
65+
5866/**
5967 * This is the default Next.js Page Metadata for all pages
6068 *
0 commit comments