Skip to content

Overview

The eminence integration is configured through a single options object. Each key maps to a distinct feature grouped by capability: file generation, icon generation, and global head tag defaults. All features are optional and can be disabled by passing false. Omitting a feature key logs a recommendation warning where applicable.

astro.config.mjs
import { defineConfig } from "astro/config";
import eminence from "eminence-astro-suite";
export default defineConfig({
site: "https://example.com",
integrations: [
eminence({
// Global head tag defaults (virtual config module)
headTags: { ... },
// Icon generation from a source image
icons: { ... },
// File generation
manifest: { ... },
robotsTxt: { ... },
securityTxt: { ... },
sitemap: { ... },
}),
],
});

These features generate static files into the build output at build time. Each can be disabled by passing false to its option key.

Generates a /manifest.webmanifest file at build time. Chromium PWA requirements (name/short_name, display/display_override, start_url) are enforced as TypeScript types. See manifest.webmanifest for full option details.

optiontyperequireddescription
namestringYes*Full app name. Required unless short_name is provided.
short_namestringYes*Short app name. Required unless name is provided.
start_urlstringYesURL loaded when the app is launched.
displaystringYes**Display mode. Required unless display_override is provided.
display_overridestring[]Yes**Ordered display mode candidates. Required unless display is provided.
iconsWebManifestIconItem[]NoIcons for the app. Generated manifest icons are added first; explicit manifest.icons are merged over them by src.
(more)Additional optional fields documented on the manifest page.

Pass manifest: false to disable generation with no warning.

Generates a /robots.txt file at build time. If a robots.txt already exists in the build output, generation is skipped. See robots.txt for full option details.

optiontyperequireddescription
rulesRobotsTxtRule | RobotsTxtRule[]YesOne or more crawl rules defining agent access.
sitemapstring | string[]NoAbsolute URL(s) or site-relative path(s) for Sitemap: entries.

Pass robotsTxt: false to disable generation with no warning.

Generates a /.well-known/security.txt file at build time following RFC 9116. See security.txt for full option details.

optiontyperequireddescription
contactstring | string[]Yesmailto: address(es) or https:// URL(s).
expiresDate | string | SecurityTxtExpiresDurationYesPolicy expiry. Accepts a Date, ISO 8601 string, or duration like "1 year".
encryptionstring | string[]NoHTTPS URL(s) to a PGP key.
policystring | string[]NoHTTPS URL(s) to the security disclosure policy.
preferredLanguagesstring | string[]NoBCP 47 language tag(s) for preferred report language(s).
(more)Additional optional fields documented on the security.txt page.

Pass securityTxt: false to disable generation with no warning.

Delegates sitemap generation to @astrojs/sitemap, which must be installed as a peer dependency. The integration is registered automatically — no need to add it separately. See Sitemap for full option details.

The sitemap option accepts a SitemapOptions object (forwarded directly to @astrojs/sitemap) or false.

Pass sitemap: false to disable the feature and suppress the peer dependency requirement.


Generates favicon and app icon files at build time from a single source image. The generated icons are automatically injected as <link> tags and, when combined with manifest, contributed to the web manifest. See Icons for full option details.

Icon resolution uses three layers:

  1. icons generates assets and base icon metadata.
  2. headTags.icons merges over generated head icon tags by href.
  3. manifest.icons merges over generated manifest icon entries by src.
optiontypedescription
sourcestringGlobal source image used when a keyed icon entry does not provide source.
[filename.ico]keyed icon entryGenerates a multi-size .ico file and optional head and manifest metadata.
[filename.svg]keyed icon entryAdds SVG metadata-only icon tags; explicit SVG entries do not generate files.
[filename.raster]keyed icon entryGenerates raster files such as PNG or WebP with inferred sizes and MIME type.

Pass icons: false to disable generation entirely with no warning.


Sets default values exposed to <head> components via the virtual config module (virtual:eminence-astro-suite/head-tags). Components read from this module automatically, so values configured here apply site-wide without repeating them per page.

All fields are optional.

optiontypedescription
charsetstringDefault charset for the Charset component.
viewportstringDefault viewport content string for the Viewport component.
baseobjectProps forwarded to the Base component.
colorSchemestringDefault color scheme for the ColorScheme component.
titleTemplatestringTitle template string for the Title component.
appleItunesAppobjectProps forwarded to the AppleItunesApp component.
generatorbooleanWhether to render the Generator tag.
iconsIconTag[]Build-time icon tags merged over generated icon tags by href.
manifeststring | URL | falseURL for the <link rel="manifest"> tag. Pass false to opt out.
openGraphSiteNamestringSite name for Open Graph tags.
robotsobjectProps forwarded to the Robots component.
themeColorstring | { light: string; dark: string }Theme color defaults for Head and ThemeColor.
humansTxtstring | URL | falseURL for the <link rel="author"> tag. Pass false to opt out.
verificationobjectProps forwarded to the Verification component.
extend.linkobject[]Additional free-form <link> tags for Head.
extend.metaobject[]Additional free-form <meta> tags for Head.
extend.customstring | string[]Raw HTML injected with set:html in Head.

Use extend.* for shared configuration defaults. For one-off page tags, prefer inserting tags directly inside the Head component slot.

extend.custom is intentionally unescaped because it uses Astro set:html; only pass trusted or pre-sanitized content.


The following features are planned and not yet released.

i18n

Coming Soon

Internationalization support for multi-language sites. Will provide locale-aware head tag defaults, alternate link management, and integration with Astro’s built-in i18n routing.

Capo.js Middleware

Coming Soon

An Astro middleware that reorders <head> tags at runtime following the capo.js priority rules. Ensures optimal resource loading order without manual tag ordering in your templates.


astro.config.mjs
import { defineConfig } from "astro/config";
import eminence from "eminence-astro-suite";
export default defineConfig({
site: "https://example.com",
integrations: [
eminence({
headTags: {
charset: "UTF-8",
viewport: "width=device-width, initial-scale=1",
titleTemplate: "%s | My Site",
colorScheme: "light dark",
humansTxt: "https://example.com/humans.txt",
},
icons: {
source: "./src/assets/icon.svg",
},
manifest: {
name: "My Site",
short_name: "MySite",
start_url: "/",
display: "standalone",
background_color: "#ffffff",
theme_color: "#0070f3",
},
robotsTxt: {
rules: { agent: "*", disallow: "/private/" },
sitemap: "/sitemap-index.xml",
},
securityTxt: {
contact: "mailto:security@example.com",
expires: "1 year",
policy: "https://example.com/security-policy",
},
sitemap: {},
}),
],
});