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'emitsabout/index.htmlrather thanabout.html, so URLs end in a slash.
Integrations
@astrojs/mdxโ lets content files mix Markdown with components@astrojs/sitemapโ generatessitemap-index.xmlat build time
Add an integration with the CLI, which installs it and wires up the config in one step:
bash
npx astro add sitemap
Unlock every theme
Get lifetime access to 2,836 themes for $199 USD (Regular $499 USD).