Non-developers can edit an Astro site in four ways: change Markdown files directly in GitHub’s web editor, use a Git-based CMS such as Decap CMS, Keystatic or TinaCMS that gives them forms and saves changes to the repository, use a visual editor service, or move content into a headless CMS that rebuilds the site when they publish. Which one fits depends on how often they edit and how comfortable they are seeing a file. In every case the site rebuilds on publish, so edits go live in a minute or two.
Key Takeaways
- Astro content usually lives in Markdown files, which anyone can edit on GitHub with no setup.
- A Git-based CMS adds forms and a preview on top of the same files, with no database or extra hosting bill.
- A headless CMS gives the best editing experience for teams but adds a subscription and an API.
- Make a site editable by moving text, settings and images out of components and into content collections.
- Preview deploys let editors check a change before it reaches the live site.
How content works in an Astro site
To edit an Astro site safely, it helps to know where the words live. In a well-built project, most text isn’t in the page templates at all. It lives in content collections: folders of Markdown or JSON files that the templates read at build time.
src/
content/
blog/ one Markdown file per post
team/ one file per person
data/
settings.json site name, navigation, contact details
assets/ images that Astro optimizes
pages/ templates (developers only)
When someone changes a file and saves it to the repository, the host runs npm run build and publishes the new version. There is no database and no admin panel by default, which is why the editing options below all work by changing files, directly or through a nicer interface.
Option 1: Edit Markdown on GitHub
The simplest way to edit an Astro site is GitHub’s own editor. Open the repository, go to src/content/blog/, click a file, click the pencil icon, change the text and commit. The host sees the commit and redeploys.
A blog post file looks like this:
---
# src/content/blog/opening-hours.md
title: New opening hours from December
description: We're open later on Thursdays.
pubDate: 2026-11-20
---
From December we're open until 8pm on Thursdays.
The part between the --- lines is the frontmatter: labelled fields the site uses for titles, dates and listings. Below it is the text, written in Markdown (**bold**, ## heading, [link](https://example.com)).
This works well for occasional edits by someone who doesn’t mind seeing a file. It costs nothing and needs no setup. The downside is that a typo in the frontmatter, like a date in the wrong format, fails the build. That is a safety net, since a broken file never reaches the live site, but it can confuse someone who doesn’t know where to look. Turning on preview deploys for branches and pull requests helps: an editor can commit to a branch, open the preview URL and check the change first.
Option 2: A Git-based CMS
A Git-based CMS puts a form-based editor in front of the same Markdown files. Editors log in at a URL like /admin/, see fields for title, date and body, and click publish. The CMS writes the file and commits it to the repository. Nothing else about the site changes.
| CMS | How editors use it | Setup notes |
|---|---|---|
| Decap CMS | Admin page at /admin/, form fields, Markdown editor |
One HTML file and one config file; needs a GitHub OAuth handler for login |
| Keystatic | Admin UI inside the site, local or GitHub mode | Astro integration; the admin routes need an adapter |
| TinaCMS | Visual editing with live preview | Self-hosted backend or Tina Cloud for GitHub mode |
Our Keystatic vs TinaCMS vs Decap comparison covers the trade-offs in detail. As a taste of how light this can be, here is a minimal Decap CMS setup for a blog collection:
<!-- public/admin/index.html -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Content editor</title>
</head>
<body>
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
</body>
</html>
# public/admin/config.yml
backend:
name: github
repo: example-co/website
branch: main
media_folder: public/images/uploads
public_folder: /images/uploads
collections:
- name: blog
label: Blog posts
folder: src/content/blog
create: true
slug: "{{slug}}"
fields:
- { label: Title, name: title, widget: string }
- { label: Description, name: description, widget: string }
- { label: Publish date, name: pubDate, widget: datetime }
- { label: Body, name: body, widget: markdown }
The field names must match the collection schema in src/content.config.ts, otherwise a post saved from the CMS fails validation at build time. Images uploaded here land in public/, which is served as is; if you want Astro to optimize editor-uploaded images, point the media folder into src/ and reference images relative to the post. The Decap CMS guide covers authentication and image handling end to end.
Option 3: A visual editor
Some services let editors click on text in a preview of the site and type over it. CloudCannon and TinaCMS’s visual mode both work this way with Astro, and they still save to files in Git. This suits clients who think in pages rather than in posts and fields. It usually needs a bit more setup from the developer, such as marking which elements are editable, and some of these services are paid.
Option 4: A headless CMS
A headless CMS (Sanity, Storyblok, Contentful, Directus, Payload and others) stores content in its own database and gives editors a polished web app with roles, drafts, scheduling and media libraries. Astro fetches the content at build time through a content loader or the CMS’s API, and a webhook rebuilds the site when someone publishes.
// src/content.config.ts (shape of a CMS-backed collection)
import { defineCollection } from 'astro:content';
import { z } from 'astro/zod';
const posts = defineCollection({
loader: async () => {
const res = await fetch(`${import.meta.env.CMS_URL}/posts`);
const items = await res.json();
return items.map((item: { slug: string }) => ({ id: item.slug, ...item }));
},
schema: z.object({ title: z.string(), body: z.string() }),
});
export const collections = { posts };
This is the most comfortable option for a marketing team with several editors, and the most work to set up. It also adds a subscription and an external dependency the site can’t build without. The headless CMS guide compares the main options with Astro.
Which option fits which editor
| Who edits | How often | Best fit |
|---|---|---|
| A founder who is fine with GitHub | A few times a year | GitHub web editor |
| A small business owner | Monthly posts and page updates | Decap CMS or Keystatic |
| A client who wants to click on the page | Occasional page edits | Visual editor |
| A marketing team with roles and approvals | Weekly or daily | Headless CMS |
| Nobody, really | Rarely | Developer makes changes on request |
If you’re not sure, start with Markdown files and a Git-based CMS. Moving from files to a headless CMS later is a change to the loader, not a rebuild of the site.
Make an Astro site easy to edit
Whatever option you pick, the site has to be built for editing. A few habits make the difference:
- Keep text out of components. Headlines, testimonials, team bios and FAQ answers belong in content files, not hard-coded in
.astrotemplates. - Put site-wide settings in one file. Name, navigation, footer links and contact details in
src/data/settings.json, loaded with thefile()loader, means an editor never opens a template. - Write a schema for every collection. Schemas catch mistakes at build time and give a CMS the fields to show.
- Use clear, human field names.
heroHeadlineis better thanh1Text. - Turn on preview deploys so every change can be checked on a temporary URL first.
// src/content.config.ts (site settings any editor can change)
import { defineCollection } from 'astro:content';
import { file } from 'astro/loaders';
import { z } from 'astro/zod';
const settings = defineCollection({
loader: file('src/data/settings.json'),
schema: z.object({
siteName: z.string(),
phone: z.string(),
email: z.email(),
nav: z.array(z.object({ label: z.string(), href: z.string() })),
}),
});
export const collections = { settings };
The content docs show how collections are organised in a project. If you start from a theme, check where its text lives before you pick an editing option; every Komal Nakrani theme ships as editable Astro source with a live preview, so you can browse Astro themes and inspect the structure first. When the site is finished, our client handoff guide covers getting the editing setup, accounts and docs into the client’s hands.
FAQ
Can I edit an Astro site without coding?
Yes. Content in an Astro site usually lives in Markdown files that you can edit in GitHub’s web editor, or through a CMS that gives you forms instead of files. You don’t need to touch the page templates to change text, posts or images.
Does Astro have a built-in admin panel or CMS?
No. Astro doesn’t ship an admin panel. You add one with a Git-based CMS such as Decap CMS, Keystatic or TinaCMS, or connect a headless CMS like Sanity or Storyblok that has its own editor.
What is the easiest CMS for an Astro site?
For a small site with one or two editors, a Git-based CMS is usually easiest because it needs no database and stores content in the same repository. Decap CMS is quick to add; Keystatic has a more modern editor and integrates with Astro directly.
How long does it take for edits to appear on an Astro site?
As long as the host takes to rebuild, usually one to a few minutes for a small site. Saving a change triggers a new build, and the updated site goes live when the build finishes.
Can I break my Astro site by editing content?
It’s hard to break the live site. If a file has an error, such as a missing title or a badly formatted date, the build fails and the host keeps serving the previous version. Fix the file and the next build publishes normally.