0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-03 22:29:08 -05:00
astro/.changeset/eighty-falcons-tease.md
ktym4a 9b78c99275
Add option to prefix sitemap (#9846)
* Add option to prefix sitemap

* Fix call resolve twice

* let to const

* Apply suggestions from code review

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>

* change changeset patch to minor

* use node:test

* Update changeset

* Add regex validation for prefix

* Update .changeset/eighty-falcons-tease.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

* Update prefix regex in SitemapOptionsSchema

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2024-02-20 08:36:09 +00:00

24 lines
773 B
Markdown

---
"@astrojs/sitemap": minor
---
Adds a new configuration option `prefix` that allows you to change the default `sitemap-*.xml` file name.
By default, running `astro build` creates both `sitemap-index.xml` and `sitemap-0.xml` in your output directory.
To change the names of these files (e.g. to `astrosite-index.xml` and `astrosite-0.xml`), set the `prefix` option in your `sitemap` integration configuration:
```
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://example.com',
integrations: [
sitemap({
prefix: 'astrosite-',
}),
],
});
```
This option is useful when Google Search Console is unable to fetch your default sitemap files, but can read renamed files.