Astro Configuration
The config file, the integrations your theme ships with, and what each one does.
Updated: September 2026·License: Commercial & Personal
astro.config.mjs
js
import { defineConfig } from 'astro/config';
import mdx from '@astrojs/mdx';
import sitemap from '@astrojs/sitemap';
export default defineConfig({
site: 'https://your-domain.com',
trailingSlash: 'ignore',
build: { format: 'directory' },
integrations: [mdx(), sitemap()],
});What each option does
site — your production URL. Required for the sitemap, RSS feed and canonical tags.trailingSlash — how strictly URLs are matched. 'ignore' accepts both forms, which is the most forgiving across hosts.build.format — 'directory' emits about/index.html rather than about.html, so URLs end in a slash.Integrations
- @astrojs/mdx — lets content files mix Markdown with components
@astrojs/sitemap — generates sitemap-index.xml at build timeAdd an integration with the CLI, which installs it and wires up the config in one step:
bash
npx astro add sitemapExplore production-ready themes
Hand-built Astro themes — SaaS, storefront, portfolio, and dashboard.