
Building Emdash Site
Build the site-facing parts of an EmDash CMS project on Astro, including schema and...
Install
npx skills add emdash-cms/emdash --skill building-emdash-site -g -a claude-code -y- Repository
- emdash-cms/emdash14.1k
- Category
- Engineering
- Updated
- 3d ago
- License
- MIT
- Context cost
- Mediumabout 1,717 tokens
- Runs scripts
- No, instructions only
What it does
Build the site-facing parts of an EmDash CMS project on Astro, including schema and seeds, content queries, Portable Text rendering, menus, taxonomies, widgets, and deployment configuration. Use for EmDash site and theme work; use creating-plugins instead when the task is plugin authoring alone.
Building an EmDash Site
EmDash is a CMS built on Astro. It stores schema in the database (not in code), serves content via live content collections, and provides a full admin UI at /_emdash/admin. Sites are standard Astro projects with the emdash integration.
Common Gotchas
These are the things that silently break sites. Know them before you start.
-
Image fields are objects, not strings.
post.data.featured_imageis{ id, src, alt }. Writing<img src={post.data.featured_image} />renders[object Object]. Use<Image image={post.data.featured_image} />from"emdash/ui". -
entry.idvsentry.data.idare different things.entry.idis the slug, prefixed with the locale (en/my-post) for locales whose URLs are prefixed (use in URLs;entry.data.slugis the bare slug).entry.data.idis the database ULID (use forgetEntryTerms,Comments, and other API calls that need the real ID). Mixing them up causes silent empty results. -
Taxonomy names must match the seed exactly. If your seed defines
"name": "category", you must querygetTerm("category", slug)-- not"categories". Wrong name = empty results, no error. -
Register cache hints when Astro's cache is enabled. Content queries return a
cacheHint; pass it toAstro.cache.set(cacheHint). UsegetSiteSettingsWithCacheHint(),getMenuWithCacheHint(),getTaxonomyTermsWithCacheHint(), andgetWidgetAreaWithCacheHint()when a cached route renders those values. -
No
getStaticPathsfor CMS content. EmDash content is dynamic. Pages must be server-rendered (output: "server"inastro.config.mjs).
File Structure
Every EmDash site has these key files:
