Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add prefix option to change output sitemap filenames #6879

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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 `sitemap-index.xml` and `sitemap-*.xml` are created in the output directory. By setting `prefix`, You can change the filename.
ktym4a marked this conversation as resolved.
Show resolved Hide resolved

```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
Loading