Filter sitemap by excluded/draft/noindex
· Updated on
1 minute read
src/routes/sitemap-appendix.xml/+server.js enumerates every +page.svelte from getPages() without honoring the excluded, draft, or noindex flags.
Engineering todos like fix-ci-type-errors and migrate-to-lightning-css get published to search engines as article content.
Current State
sitemap-appendix.xml/+server.js:46-52— no filter at allsitemap/+page.server.js:73— excludes only the sitemap page itselfpages.remote.js getReadNext:50— filters bothexcludedanddraft
Tasks
- Centralize inclusion policy in a single helper (e.g.
isPublic(page)) - Honor
excluded,draft,noindex - Apply the helper in all three consumers
Read next
Stop leaking internal pages
One inclusion policy for sitemap, HTML sitemap, and ReadNext
Get Started