building-emdash-site
What it does
This skill helps build websites on EmDash, a content management system built on Astro, including content queries, page rendering and site setup. It is for web developers creating or changing an EmDash site.
When to use it
- βWhen you are starting a new website on EmDash and need its content structure set up.
- βWhen you need to display content such as posts, menus or categories on the site.
- βWhen images, taxonomy terms or content are not appearing and you need to find the cause.
Skill link
https://github.com/emdash-cms/emdash/blob/main/skills/building-emdash-site/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βCan you help me set up a blog section on my EmDash site, with categories and featured images on each post?β
5 new skills a week. 1 minute to read.
How it works
The agent sets up the content schema and seed data, writes queries for the content, and renders the results with Astro components. It also flags common pitfalls, such as image fields being objects rather than plain text.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
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:
my-site/
βββ astro.config.mjs # Astro config with emdash() integration
βββ src/
β βββ live.config.ts # EmDash loader registration (boilerplate)
β βββ pages/ # Astro pages (all server-rendered)
β βββ layouts/ # Layout components
β βββ components/ # Reusable components
βββ seed/
β βββ seed.json # Schema + demo content
βββ emdash-env.d.ts # Generated types (from `emdash types`)
βββ package.json
Workflow
1. Configure the project
Read references/configuration.md for astro.config.mjs, live.config.ts, deployment targets (Node vs Cloudflare), and type generation.
2. Design the schema
Read references/schema-and-seed.md for collection definitions, field types, taxonomies, menus, widget areas, sections, bylines, and the complete seed file format.
3. Build the pages
Read references/querying-and-rendering.md for content queries, Portable Text rendering, the Image component, visual editing attributes, caching, and common page patterns (list, detail, taxonomy archive, RSS, search, 404).
4. Wire up site features
Read references/site-features.md for site settings, navigation menus, taxonomies, widget areas, search, SEO meta, comments, and page contributions.
5. Create the seed file
Write seed/seed.json with collections, fields, taxonomies, menus, widgets, and sample content.
6. Run and verify
pnpm dev # Start the Astro dev server
The runtime runs pending migrations on the first request and, before setup is completed, applies the seed's schema and structure once. Sample content needs an explicit step; see Applying Seeds. The Astro integration generates emdash-env.d.ts when the server starts. The admin UI is at http://localhost:4321/_emdash/admin.
Quick API Cheat Sheet
// Content (entries have .data.byline and .data.bylines eagerly loaded)
import { getEmDashCollection, getEmDashEntry } from "emdash";
const { entries, nextCursor, cacheHint } = await getEmDashCollection("posts", {
limit: 10,
cursor,
orderBy: { published_at: "desc" },
});
const { entry: post, cacheHint: entryCacheHint } = await getEmDashEntry("posts", slug);
// Site features
import {
getSiteSettings,
getSiteSettingsWithCacheHint,
getMenu,
getMenuWithCacheHint,
getTaxonomyTerms,
getTaxonomyTermsWithCacheHint,
getTerm,
getEntryTerms,
getEntriesByTerm,
getWidgetArea,
getWidgetAreaWithCacheHint,
search,
getSection,
getSeoMeta,
} from "emdash";
// Bylines (standalone queries -- usually not needed since ent
FAQ
What is EmDash?
It is a content management system built on Astro that keeps its structure in the database.
Why do my images show as object text?
Image fields are objects, so they must be displayed with the image component rather than as plain text.
Does it include admin screens?
Yes. EmDash provides a built-in admin interface for editing content.
Details
Original description by the author
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.
repo: emdash-cms/emdash
Popularity
- GitHub stars
- 14k
- Ranking position
- #11246
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
adversarial-reviewer
14kHelps your agent hunt for hidden bugs and unsafe assumptions in a code change, going beyond an ordinary review when you ask for it.
agent-browser
14kLets your agent test a web page in a real browser, check what users see, verify actions and capture screenshots as evidence.
creating-plugins
14kHelps your agent build a plugin for the EmDash CMS, with safe hooks, routes, storage and an admin interface.
emdash-cli
14kLets your agent manage an EmDash site from the command line, including content, media, menus, migrations and full site export or import.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.