Skip to content

Commit ce4cdbf

Browse files
committed
Fix sitemap: include the /packages page, exclude the exported 404 page
Verified against the first production sitemap (268 URLs): - /packages/ was missing. The top-level 'packages' exclusion was meant for the package-repository metadata the deploy workflow adds, but the Next.js /packages download page also exports to out/packages/ - and the workflow only ever adds release-info.json there (not a page), and only after the sitemap step has already run. Stop excluding it. - /404/ was listed. With trailingSlash the export emits out/404/ index.html alongside out/404.html; the directory form needs an explicit exclusion. Re-tested against a mock out/ tree that now models the real export shape (404/ directory, packages/ page plus release-info.json).
1 parent 9e46914 commit ce4cdbf

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

scripts/generate-sitemap.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ const siteUrl = 'https://documentdb.io';
1212
const outDir = path.join(process.cwd(), 'out');
1313

1414
// Top-level build outputs that are not HTML pages: Next.js assets, the APT/RPM
15-
// package repositories, release metadata, and images. The packages workflow
16-
// adds deb/, rpm/, and packages/ after this script runs in the deploy job, but
17-
// they are excluded here too so local full builds behave identically.
15+
// package repositories, images, and the not-found page (with trailingSlash the
16+
// export emits out/404/index.html alongside out/404.html). The packages
17+
// workflow adds deb/ and rpm/ after this script runs in the deploy job, but
18+
// they are excluded here too so local full builds behave identically. Note
19+
// that out/packages/ is NOT excluded: it is the exported /packages download
20+
// page; the workflow only adds release-info.json (not a page) next to it.
1821
const excludedTopLevelDirectories = new Set([
1922
'_next',
2023
'deb',
2124
'rpm',
22-
'packages',
2325
'images',
26+
'404',
2427
]);
2528

2629
function xmlEscape(value) {

0 commit comments

Comments
 (0)