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.
Options
Section titled “Options”The sitemap option accepts a SitemapOptions object (re-exported from @astrojs/sitemap) or false to disable it.
| option | type | default | description |
|---|---|---|---|
sitemap | SitemapOptions | 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.
Usage & Examples
Section titled “Usage & Examples”Enables sitemap generation with explicit default options. Requires site to be set in your Astro config.
Input:
eminence({ sitemap: {},});Output: @astrojs/sitemap is registered with default options and generates sitemap-index.xml in your build output.
Automatic
Section titled “Automatic”Omitting sitemap entirely is equivalent to sitemap: {} — the feature is enabled with default options.
Input:
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.
Complete
Section titled “Complete”All available options provided explicitly.
Input:
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.
Explicit opt-out
Section titled “Explicit opt-out”Input:
eminence({ sitemap: false,});Output: No sitemap integration is registered. @astrojs/sitemap does not need to be installed.
Decisions Made
Section titled “Decisions Made”Delegates entirely to @astrojs/sitemap
Section titled “Delegates entirely to @astrojs/sitemap”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.
@astrojs/sitemap is a required peer
Section titled “@astrojs/sitemap is a required peer”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.
Registered during astro:config:setup
Section titled “Registered during astro:config:setup”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.