0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

fix: Add html extension if build.format is file

This commit is contained in:
Javier de la Rubia (@fjdelarubia) 2024-08-12 21:13:40 +02:00
parent 64f81e92d1
commit 8100c5cb2b

View file

@ -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);