본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)14k · #11246

building-emdash-site

하는 일

이 스킬은 콘텐츠 쿼리, 페이지 렌더링, 사이트 설정을 포함해 Astro 위에 만들어진 콘텐츠 관리 시스템 EmDash로 웹사이트를 만드는 것을 돕습니다. EmDash 사이트를 새로 만들거나 바꾸는 웹 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓EmDash에서 새 웹사이트를 시작하고 콘텐츠 구조를 설정해야 할 때.
  • ✓사이트에 게시글, 메뉴, 카테고리 같은 콘텐츠를 표시해야 할 때.
  • ✓이미지, 분류 용어, 콘텐츠가 보이지 않아 원인을 찾아야 할 때.

스킬 링크

https://github.com/emdash-cms/emdash/blob/main/skills/building-emdash-site/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/emdash-cms/emdash/blob/main/skills/building-emdash-site/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“내 EmDash 사이트에 블로그 섹션을 만들고, 각 글에 카테고리와 대표 이미지를 넣는 것을 도와줄 수 있나요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 콘텐츠 스키마와 시드 데이터를 설정하고, 콘텐츠를 위한 쿼리를 작성하며, Astro 컴포넌트로 결과를 렌더링합니다. 이미지 필드가 일반 텍스트가 아니라 객체라는 등 흔한 함정도 표시합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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.

  1. Image fields are objects, not strings. post.data.featured_image is { id, src, alt }. Writing <img src={post.data.featured_image} /> renders [object Object]. Use <Image image={post.data.featured_image} /> from "emdash/ui".

  2. entry.id vs entry.data.id are different things. entry.id is the slug, prefixed with the locale (en/my-post) for locales whose URLs are prefixed (use in URLs; entry.data.slug is the bare slug). entry.data.id is the database ULID (use for getEntryTerms, Comments, and other API calls that need the real ID). Mixing them up causes silent empty results.

  3. Taxonomy names must match the seed exactly. If your seed defines "name": "category", you must query getTerm("category", slug) -- not "categories". Wrong name = empty results, no error.

  4. Register cache hints when Astro's cache is enabled. Content queries return a cacheHint; pass it to Astro.cache.set(cacheHint). Use getSiteSettingsWithCacheHint(), getMenuWithCacheHint(), getTaxonomyTermsWithCacheHint(), and getWidgetAreaWithCacheHint() when a cached route renders those values.

  5. No getStaticPaths for CMS content. EmDash content is dynamic. Pages must be server-rendered (output: "server" in astro.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
자주 묻는 질문

EmDash란 무엇인가요?

Astro 위에 만들어진 콘텐츠 관리 시스템으로, 구조를 데이터베이스에 보관합니다.

이미지가 객체 텍스트로 보이는 이유는 무엇인가요?

이미지 필드는 객체이므로, 일반 텍스트로 표시하지 않고 이미지 컴포넌트로 표시해야 합니다.

관리자 화면도 포함되나요?

네. EmDash는 콘텐츠를 편집하는 기본 제공 관리 인터페이스를 제공합니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
14k
순위
#11246
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬