Skip to content
Code on a monitor in a dark room
Roger Stringer2 min read

Why we're EmDashing it all

EmDash puts the CMS inside your Astro site. That one decision changes what you build, what you run, and how you migrate.

EmDash is a content management system built for Astro. The admin panel lives in the same application as your website, and your pages read content from a database when they render. No separate CMS service, no webhook to trigger a rebuild, no second deploy.

That sounds like a small architectural detail. It isn't. It's the reason this blog exists.

One app, one deploy

With a headless CMS you run two things: the CMS and the frontend. They deploy separately and talk over a network API. With file-based Astro collections you run one thing, but editors have to work in Git.

EmDash takes a third path. Editors get a real admin at /_emdash/admin. Developers get query functions like getEmDashCollection() and getEmDashEntry() that return entries, errors and cache hints. Both ship in one Astro app.

src/pages/posts/[slug].astro
---
import { decodeSlug, getEmDashEntry } from "emdash";
import { PortableText } from "emdash/ui";

const slug = decodeSlug(Astro.params.slug);
if (!slug) return Astro.rewrite("/404");

const { entry: post } = await getEmDashEntry("posts", slug);
if (!post) return Astro.rewrite("/404");
---
<article>
  <h1>{post.data.title}</h1>
  <PortableText value={post.data.content} />
</article>

Because EmDash plugs into Astro's live content collections, a server-rendered page shows a published edit on the very next request.

Who it fits

EmDash is a good fit when the site is built with Astro, editors need to work without touching the repo, and your team is happy to operate a database and media storage alongside the site. Agency sites handed to client editors are the obvious case. So is a WordPress site whose frontend is being rebuilt anyway.

EmDash does not run PHP, WordPress themes or WordPress plugins. It imports your content. The design and any custom behavior get rebuilt for Astro.

That last point is where most of the work in a migration lives, and it's what we'll spend a lot of time on here.

What we'll cover

  • Migration: WordPress imports, what converts cleanly, and what needs a human.
  • Deployment: Cloudflare Workers with D1 and R2, plus the Node.js path.
  • Plugins: porting WordPress plugin behavior to EmDash hooks, routes and admin pages.
  • Guides: the small, specific things that take an afternoon to figure out.

This site runs on EmDash, on Cloudflare, so everything we write about gets tested here first.