Skip to content

Sitemap

The sitemap feature delegates sitemap generation to @astrojs/sitemap, Astro’s official sitemap integration. Eminence Astro Suite registers it automatically when sitemap is configured, so you do not need to add it separately to your astro.config.mjs.

You must install @astrojs/sitemap as a peer dependency. If it is not installed and sitemap is not set to false, the integration throws an error at build time with a clear installation message.

The sitemap option accepts a SitemapOptions object (re-exported from @astrojs/sitemap) or false to disable it.

optiontypedefaultdescription
sitemapSitemapOptions | false{} (enabled with defaults)Options forwarded directly to @astrojs/sitemap. Pass false to opt out.

See the @astrojs/sitemap documentation for the full list of supported options.

Enables sitemap generation with explicit default options. Requires site to be set in your Astro config.

Input:

astro.config.mjs
eminence({
sitemap: {},
});

Output: @astrojs/sitemap is registered with default options and generates sitemap-index.xml in your build output.

Omitting sitemap entirely is equivalent to sitemap: {} — the feature is enabled with default options.

Input:

astro.config.mjs
eminence({
// sitemap not provided
});

Output: Same as Basic — @astrojs/sitemap is registered with default options. If @astrojs/sitemap is not installed, the build fails with a peer dependency error.

All available options provided explicitly.

Input:

astro.config.mjs
eminence({
sitemap: {
filter: (page) => !page.includes("/private/"),
changefreq: "weekly",
priority: 0.8,
lastmod: new Date(),
},
});

Output: @astrojs/sitemap is registered with the provided options. Pages matching the filter are excluded from the generated sitemap.

Input:

astro.config.mjs
eminence({
sitemap: false,
});

Output: No sitemap integration is registered. @astrojs/sitemap does not need to be installed.

Rather than reimplementing sitemap generation, the integration wraps @astrojs/sitemap directly. This means all upstream features, bug fixes, and options are available without any additional maintenance surface in this package.

The package is not bundled so consumers manage its version independently. This avoids version conflicts when a project already uses @astrojs/sitemap elsewhere, and keeps the dependency graph explicit.

The sitemap integration is injected via updateConfig({ integrations: [...] }) in the astro:config:setup hook. This ensures proper ordering and compatibility with Astro’s integration pipeline.

Setting false disables the peer requirement

Section titled “Setting false disables the peer requirement”

When sitemap: false is passed, the integration does not attempt to import @astrojs/sitemap, so the peer package does not need to be installed.