Source of truth
Start with the site-owned sitemap
Your application sitemap should contain every canonical public URL, including dynamic pages. Treat it as the source of truth for what is live, indexable, and worth discovering.
- Use the same public origin as the pages.
- Include updated timestamps from the source record when possible.
- Do not include preview, authenticated, or redirected URLs.
export default function sitemap() {
return publicPages.map((page) => ({
url: `https://example.com${page.path}`,
lastModified: page.updatedAt,
}));
}