Skip to main content

Configuration overview

The integration is configured with a single options object passed to the redGlare() factory in astro.config.mjs. Every option is validated against a zod schema — mismatches fail the build with a clear error.

import redGlare from '@red-glare/astro'
import { defineConfig } from 'astro/config'

export default defineConfig({
  site: 'https://docs.example.gov',
  integrations: [
    redGlare({
      title: 'My Agency Docs',
      description: 'Official documentation for My Agency',
      governmentBanner: true,
      pagefind: true,
      rss: true,
      // ...
    }),
  ],
})

Option reference

OptionTypeDefaultDocs
titlestringrequiredSite metadata
descriptionstringSite metadata
logostringSite metadata
governmentBannerbooleantrueGovernment banner
alert{ message, type, dismissible }Government banner
editLink{ baseUrl }Edit links
sidebarSidebarGroup[]autoNavigation
navNavItem[]auto from sidebarNavigation
footer{ links, contact, social }Footer & identifier
identifier{ agency, parentAgency, links, ... }Footer & identifier
pagefindbooleanfalseSearch
rssbooleanfalseRSS
llmsbooleantruellms.txt
defaultLocalestring"en"i18n
localesRecord<string, { label }>i18n
headHeadTag[][]Site metadata
uswdsSettingsstringTheming

Where options are validated

RedGlareConfigSchema is defined in packages/astro/src/config.ts. The integration calls schema.parse(userConfig) on entry, so a missing title or a wrongly-typed sidebar[].items is caught before any build work happens — you see the failure in the terminal immediately.

Re-exported types

The package exports TypeScript types for the config object — useful when you split the configuration across modules or pass it through a helper:

import type { RedGlareUserConfig } from '@red-glare/astro'

const config: RedGlareUserConfig = {
  title: 'My Agency Docs',
  governmentBanner: true,
}

RedGlareUserConfig is the input type (defaults not yet applied). RedGlareConfig is the parsed output. Most authors want the former.

Next

Site metadataNavigation

Red Glare

An official website of the Open source project

Looking for U.S. government information and services? Visit USA.gov