diff --git a/packages/integrations/sitemap/src/index.ts b/packages/integrations/sitemap/src/index.ts index 56f257105849..5fb8319dca03 100644 --- a/packages/integrations/sitemap/src/index.ts +++ b/packages/integrations/sitemap/src/index.ts @@ -37,7 +37,10 @@ export type SitemapOptions = serialize?(item: SitemapItem): SitemapItem | Promise | undefined; xslURL?: string; + /** Allows you to configure the separator used in the sitemap file names. Defaults to `-`. */ separator?: string; + /** Allows you to configure the index file name. Defaults to `sitemap-index`. */ + indexFilename?: string } | undefined; @@ -69,8 +72,9 @@ const isStatusCodePage = (locales: string[]) => { const createPlugin = (options?: SitemapOptions): AstroIntegration => { let config: AstroConfig; let separator = options?.separator ?? '-'; + let indexFilename = options?.indexFilename ?? 'sitemap-index'; - let outfile = `sitemap${separator}index.xml`; + let outfile = `${indexFilename}.xml`; return { name: PKG_NAME,