mirror of
https://github.com/withastro/astro.git
synced 2025-01-20 22:12:38 -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 ?? [])]));
|
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 {
|
try {
|
||||||
if (filter) {
|
if (filter) {
|
||||||
pageUrls = pageUrls.filter(filter);
|
pageUrls = pageUrls.filter(filter);
|
||||||
|
|
Loading…
Add table
Reference in a new issue