mirror of
https://github.com/withastro/astro.git
synced 2025-01-27 22:19:04 -05:00
9b78c99275
* 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>
773 B
773 B
@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.