Remove /404 & /[...slug] from sitemap

This commit is contained in:
Dávid Lévai authored and GitHub committed 2021-06-20 11:38:37 +02:00
1 parent 70ac88bac8
commit c741e0894c
1 file changed
+3
+3
View File
@@ -28,6 +28,9 @@ const siteMetadata = require('../data/siteMetadata')
.replace('.md', '')
.replace('/index.xml', '')
const route = path === '/index' ? '' : path
if (page === `pages/404.js` || page === `pages/[...slug].js`) {
return
}
return `
<url>
<loc>${`${siteMetadata.siteUrl}${route}`}</loc>