Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/core/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
}
Expand Down