Skip to content

Why EmDash

EmDash is a content management system built for Astro. It adds an editor-facing admin panel to the same application as your website. Astro pages read the content from a database when they render.

This page explains that choice so you can decide whether it fits your project.

An editor creates or updates an entry in the admin panel. EmDash saves the entry in the configured database. When Astro renders a page, your page calls an EmDash query function and receives the published entry.

EmDash connects those queries to Astro’s Live Content Collections, which load content on demand instead of only during a build. A server-rendered page can therefore show a published edit on its next request. A prerendered page remains static until you rebuild it.

Astro components still control the site’s HTML and design. EmDash manages structured content; it is not a visual page builder.

EmDash is a good fit when all of the following are true:

  • The website is built with Astro.
  • Editors need to manage content without editing repository files.
  • Developers want the CMS and website in one application and deployment.
  • Developers can operate a database and media storage with the site.

Common examples include agency-built sites handed to client editors, an Astro site maintained by a small development team, and a WordPress migration where the frontend is being rebuilt with Astro.

EmDash does not run PHP, WordPress themes, or WordPress plugins. It can import WordPress content, and the migration guides explain how WordPress concepts and plugin behavior map to EmDash. The site design and any custom plugin behavior still need to be implemented for Astro and EmDash.

Editors use the admin panel

Editors work with forms generated from your collections and fields. Depending on their permissions, they can manage drafts, publishing, media, taxonomies, menus, and widget areas.

Developers use Astro

Developers write the pages, layouts, and components that display the content. EmDash query functions return entries, errors, pagination information, and cache hints.

The content model can change

Administrators can add collections and fields in the admin panel. Developers can export the model as a seed file and generate TypeScript declarations for collection names and fields.

Generated declarations describe the model at the time they were generated. During local development, EmDash refreshes emdash-env.d.ts when the model changes. Other workflows that use emdash types need to regenerate their output after a schema change.

Comparison with other Astro content sources

Section titled “Comparison with other Astro content sources”

The following options solve different problems. A file-based collection keeps content in the repository. A separate headless CMS runs its own admin application and supplies content over a network API. EmDash keeps the admin and content runtime inside the Astro application.

DecisionEmDashFile-based Astro collectionSeparate headless CMS
Where editors workAdmin panel served by the Astro applicationRepository files and development toolsCMS provider or separately operated admin application
When pages load contentWhen a server-rendered page is requestedDuring development or a site buildDuring a build or request, through a network API
Where the model is definedEmDash database, through the admin panel or CLISource code in the repositoryCMS configuration
What the team operatesAstro application, database, and media storageAstro application and build pipelineAstro application plus the CMS account or service
How releases are separatedAdmin and frontend deploy togetherContent and frontend usually build togetherCMS and frontend deploy independently

Choose file-based collections when content belongs in version control and contributors are comfortable with a Git workflow. Choose a separate headless CMS when several applications need one independently deployed content service. Choose EmDash when editors and the Astro site benefit from one application and your team accepts the shared deployment.

EmDash supports two main deployment shapes:

  • Cloudflare Workers: Cloudflare D1 stores content and R2 stores media.
  • Node.js: SQLite, libSQL, or PostgreSQL stores content. The local filesystem or an S3-compatible service stores media.

The database contains the content model as well as entries. Administrators can change that model while the site is running. Adding a field preserves existing entries, but the existing entries have no value for the new field until an editor or migration supplies one.

Plugins can react to content and media events and add settings, routes, admin pages, dashboard widgets, or editor controls. EmDash has two plugin formats with different trust boundaries:

  • Native plugins run as part of the host application and have its access.
  • Standard-format plugins can run in an isolated runtime when you configure a sandbox runner and grant the capabilities they need.

Review the plugin formats before choosing or building an extension.

EmDash is unlikely to fit when the project is not built with Astro, all content must remain in the source repository, or several unrelated frontends need a CMS that deploys independently. It also adds operational work: the team is responsible for the database, media storage, backups, upgrades, and the application that serves the admin panel.

If this model fits, follow Create your first EmDash site for a local tutorial or Add EmDash to an existing Astro project for an existing application.