Skip to content
Open
Changes from 4 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
27 changes: 27 additions & 0 deletions src/content/docs/en/guides/integrations-guide/sitemap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,33 @@ export default defineConfig({

The given configuration will generate sitemap files at `https://example.com/astronomy-sitemap-0.xml` and `https://example.com/astronomy-sitemap-index.xml`.

### `namespaces`

**Type:** `{ news?: boolean; xhtml?: boolean; image?: boolean; video?: boolean; }`
**Default:** `{ news: true, xhtml: true, image: true, video: true }`

Controls which XML namespaces are included in the sitemap generation.

By default, all namespaces default to `true` and you must explicitly set each one you want to change to `false`.

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

export default defineConfig({
site: 'https://example.com',
integrations: [
sitemap({
// Only include image and video namespaces
namespaces: {
news: false,
xhtml: false,
// image and video will be true by default
}
})
]
});

## Examples

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