We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 735e3c5 commit 4a17c12Copy full SHA for 4a17c12
scripts/sitemap.mjs
@@ -10,11 +10,13 @@ const PUBLIC_BASE = 'https://luk.ke/';
10
11
12
export const getPaths = () => glob('**/*.html', { cwd: '.next/server/pages', onlyFiles: true })
13
+ // Remove .html extensions and remove "index.html" filenames from the ends of paths
14
.then((paths) => paths.map(((p) => {
- // Remove .html extensions and remove "index.html" filenames from the ends of paths
15
const { dir, name } = path.parse(p);
16
return `/${name === 'index' ? dir : path.join(dir, name)}`;
17
})))
18
+ // Exclude error code pages (404, 500)
19
+ .then((paths) => paths.filter((p) => !/^\/[0-9]{3}$/.test(p)))
20
.then((paths) => paths.sort());
21
22
export async function getSitemap() {
0 commit comments