diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index 057fc2371d..6b91246264 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -132,6 +132,18 @@ const createPlugin = (options?: SitemapOptions): AstroIntegration => { pageUrls = Array.from(new Set([...pageUrls, ...routeUrls, ...(customPages ?? [])])); + if(config.build.format === 'file') { + pageUrls = pageUrls.map((url) => { + + if(url.endsWith('/')) { + return url; + } + + return url + '.html'; + + }); + } + try { if (filter) { pageUrls = pageUrls.filter(filter);