fix: 사이트맵에서 내일 페이지(/tomorrow/…)와 시도별 FAQ(/faq/{시도}) 제외 — 페이지는 그대로 만들고 noindex 는 넣지 않음

This commit is contained in:
skkim committed 2026-11-13 15:46:14 +09:00
1 parent 1dd74bda05
commit 9ff44143b5
1 file changed
+3 -1
+3 -1
View File
@@ -282,7 +282,9 @@ function seoPages(): Plugin {
writeFileSync(file, f.html)
}
const today = new Date().toISOString().slice(0, 10)
const urls = ['', ...faqs.map((f) => f.path), ...PAGES.map((p) => p.path)].map((path) => ` <url><loc>${site}/${path}</loc><lastmod>${today}</lastmod></url>`)
// 내일 페이지와 시도별 FAQ 는 페이지는 만들되 사이트맵에는 넣지 않는다 (틀이 같은 주소가 너무 많아서)
const listed = [...faqs, ...PAGES].map((p) => p.path).filter((path) => !path.startsWith('tomorrow/') && !path.startsWith('faq/'))
const urls = ['', ...listed].map((path) => ` <url><loc>${site}/${path}</loc><lastmod>${today}</lastmod></url>`)
writeFileSync(resolve(outDir, 'sitemap.xml'), `<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n${urls.join('\n')}\n</urlset>\n`)
},
}