Skip to content

Decap CMS & Astro

Add content to your Astro project using Decap as a CMS

Decap CMS (formerly Netlify CMS) is an open-source, Git-based content management system.

Decap allows you to take full advantage of all of Astro’s features, including image optimization and content collections.

Decap adds a route (typically /admin) to your project that will load a React app to allow authorized users to manage content directly from the deployed website. Decap will commit changes directly to your Astro project’s source repository.

There are two options for adding Decap to Astro:

  1. Install Decap via a package manager with the following command:

  2. Import the package into a <script> tag in your page <body>

    /admin
    <body>
    <!-- Include the script that builds the page and powers Decap CMS -->
    </body>

See the Decap CMS configuration documentation for full instructions and options.

Navigate to yoursite.com/admin/ to use the Decap CMS editor.

Decap CMS was originally developed by Netlify and has first class support for Netlify Identity.

When deploying to Netlify, configure Identity for your project via the Netlify dashboard and include the Netlify Identity Widget on the admin route of your project. Optionally include the Identity Widget on the homepage of your site if you plan to invite new users via email.

When deploying to hosting providers other than Netlify, you must create your own OAuth routes.

In Astro, this can be done with on-demand rendered routes in your project configured with an adapter enabled.

See Decap’s OAuth Docs for a list of compatible community-maintained OAuth clients.