Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/content/docs/en/guides/integrations-guide/sitemap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,24 @@ The resulting sitemap looks like this:
...
```

### prefix

By default, files named `sitemap-index.xml` and `sitemap-*.xml` are created in the output directory when you run `astro build`. You can change these filenames by adding a value for `prefix` in your `sitemap()` configuration.

```js title="astro.config.mjs" ins={8}
import { defineConfig } from 'astro/config';
import sitemap from '@astrojs/sitemap';

export default defineConfig({
site: 'https://stargazers.club',
integrations: [
sitemap({
prefix: 'astrosite-', // output files will be `astrosite-index.xml` and `astrosite-*.xml`.
}),
],
});
```

## Examples

* The official Astro website uses Astro Sitemap to generate [its sitemap](https://astro.build/sitemap-index.xml).
Expand Down