diff --git a/src/core/sitemap.ts b/src/core/sitemap.ts index 13b5204..5306fa7 100644 --- a/src/core/sitemap.ts +++ b/src/core/sitemap.ts @@ -37,12 +37,17 @@ function escapeXml(str: string): string { .replace(/'/g, '''); } +function isSitemapPathname(pathname: string): boolean { + return /^\/sitemap/i.test(pathname); +} + export function generateSitemap(config: ResolvedAeoConfig): string { const urls: string[] = []; // Add discovered pages from framework plugin if (config.pages && config.pages.length > 0) { for (const page of config.pages) { + if (isSitemapPathname(page.pathname)) continue; urls.push(`${config.url}${page.pathname === '/' ? '' : page.pathname}`); } }