๐Ÿ”ฅ All-Access Pass โ€” $199 USD (Regular $499) ยท Unlock all 2,836 Astro themes โž”
komal.nakrani
Get All-Access Pass ($199)
ThemesCategoriesDocsBlogTips & TricksPricingGet All-Access Pass ($199)
Docs/Working With Your Theme/Astro Configuration

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 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).

Get All-Access Pass ($199) โž”