Themes
An EmDash theme is a complete Astro project distributed as a create-astro template. It contains the public routes and components, EmDash runtime configuration, and an optional seed file for the site’s initial content model.
There is no runtime theme package or template hierarchy. After scaffolding, the theme files belong to the site and can be edited directly.
Theme contents
Section titled “Theme contents”Current EmDash templates use these paths:
astro.config.mjspackage.jsonseed/└── seed.jsonsrc/├── components/├── layouts/├── live.config.ts├── pages/└── styles/astro.config.mjsconfigures server output, the deployment adapter, EmDash, the database, and storage.src/live.config.tsregisters the_emdashlive collection.src/pages/defines public routes.seed/seed.jsoncan declare initial collections, fields, settings, taxonomies, bylines, menus, redirects, widget areas, sections, and sample content.package.json#emdash.seedpoints to the seed file.
The blank template deliberately has no user seed and falls back to EmDash’s built-in default seed. The other current templates point to seed/seed.json.
Install a template
Section titled “Install a template”The following command scaffolds the Node blog template:
npm create astro@latest -- --template @emdash-cms/template-blogUse the corresponding -cloudflare package for a Cloudflare Workers project:
npm create astro@latest -- --template @emdash-cms/template-blog-cloudflareCurrent template packages include:
| Purpose | Node | Cloudflare |
|---|---|---|
| Empty project shell | @emdash-cms/template-blank |
No current counterpart |
| Basic pages site | @emdash-cms/template-starter |
@emdash-cms/template-starter-cloudflare |
| Posts, pages, categories, tags, and widgets | @emdash-cms/template-blog |
@emdash-cms/template-blog-cloudflare |
| Project portfolio | @emdash-cms/template-portfolio |
@emdash-cms/template-portfolio-cloudflare |
| Marketing pages composed from versioned blocks | @emdash-cms/template-marketing |
@emdash-cms/template-marketing-cloudflare |
After scaffolding, install dependencies and start the generated site:
cd my-sitenpm installnpm run devOpen http://localhost:4321/_emdash/admin. The first visit redirects to setup, where you enter the site identity and administrator details. When the selected template has sample entries, the wizard also lets you include or omit them. Including them is useful while evaluating the design because the routes have realistic content to render.
First setup
Section titled “First setup”EmDash reads the seed at build time. It looks in this order:
.emdash/seed.json.- The path in
package.json#emdash.seed. seed/seed.json.- The built-in default seed when no user seed is found.
On the first admin visit, the setup wizard shows seed metadata and lets the administrator choose whether to include sample content. It applies the seed to an empty database and records setup completion. Later starts do not reapply the seed to an existing site.
Customize the installed site
Section titled “Customize the installed site”Edit the generated project directly:
- Change route files in
src/pages/. - Change shared markup in
src/layouts/andsrc/components/. - Change the initial model in
seed/seed.jsonbefore first setup. - Manage an existing site’s model under Content Types in the admin.
Use Creating themes to prepare a reusable template and Seed files for the complete seed contract.