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:
parent
64f81e92d1
commit
8100c5cb2b
1 changed files with 12 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue