Astro Configuration
The CMS integration is added to your astro.config.ts file.
It accepts an optional configuration object to customize its behavior.
Basic Setup
Section titled “Basic Setup”import { defineConfig } from "astro/config";import mdx from "@astrojs/mdx";import react from "@astrojs/react";import cms from "astronaut-cms";
export default defineConfig({ integrations: [mdx(), react(), cms()],});Configuration Options
Section titled “Configuration Options”Pass options to cms() to customize the integration:
cms({ mountPoint: "/admin", locale: "en", storage: { type: "local" }, media: { repo: { directory: "src/assets", maxFileSize: 10_000_000 }, },});mountPoint
Section titled “mountPoint”- Type:
string - Default:
"/admin"
The URL path where the admin panel is served.
@astrojs/sitemap lists every page route, the admin included, and another integration cannot take one out.
Exclude it with the sitemap’s filter.
The integration warns when a built sitemap still lists the admin, provided sitemap() comes before cms() in integrations, since it reads the files the sitemap wrote.
sitemap({ filter: (page) => !new URL(page).pathname.startsWith("/admin") });config
Section titled “config”- Type:
string - Default: auto-discovered from
src/cms.config.{ts,mts,js,mjs}
Path to the CMS config file, relative to the project root.
locale
Section titled “locale”- Type:
"en" | "de" - Default:
"en"
Default language for the admin panel UI. Editors can change it from the header, and their choice is remembered.
- Type:
{ locales?: string[]; defaultLocale?: string } | false - Default: inherited from the site’s own
i18ninastro.config.ts
Content languages.
Set it to override the site’s languages, or to false to keep the admin language-agnostic.
See the Multilingual Content guide for details.
storage
Section titled “storage”- Type:
StorageConfig - Default:
{ type: "local" }
Storage backend configuration. See the Storage Backends guide for details.
- Type:
MediaConfig - Default:
{ repo: { directory: "src/assets" } }
The media libraries: the repository library, and optionally an object store beside it. See the Media Library guide for details.
