Skip to content

Commit

Permalink
Remove .html extension from build urls
Browse files Browse the repository at this point in the history
  • Loading branch information
fjdelarubia committed Sep 30, 2024
1 parent 692d493 commit 5b055c4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion packages/astro/src/core/build/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function getUrlForPath(
break;
}
default: {
ending = '.html';
ending = '';
break;
}
}
Expand Down
12 changes: 0 additions & 12 deletions packages/integrations/sitemap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,6 @@ 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);
Expand Down

0 comments on commit 5b055c4

Please sign in to comment.