building-emdash-site
できること
このスキルは、AstroをベースにしたCMSであるEmDashでWebサイトを構築する手助けをします。コンテンツのクエリ、ページの描画、サイトの設定を含みます。EmDashのサイトを作ったり変更したりするWeb開発者向けです。
使う場面
- ✓EmDashで新しいWebサイトを始め、コンテンツの構造を設定する必要があるとき。
- ✓投稿、メニュー、カテゴリなどのコンテンツをサイトに表示したいとき。
- ✓画像、分類の用語、コンテンツが表示されず、その原因を探す必要があるとき。
スキルのリンク
https://github.com/emdash-cms/emdash/blob/main/skills/building-emdash-site/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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.
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
よくある質問
EmDashとは何ですか?
Astroの上に作られたCMSで、その構造をデータベースに保持します。
画像がオブジェクトのテキストとして表示されるのはなぜですか?
画像の項目はオブジェクトなので、普通のテキストとしてではなく画像のコンポーネントを使って表示する必要があります。
管理画面も含まれますか?
はい。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
コメント
- …
このリポジトリの他のスキル
adversarial-reviewer
14kエージェントが、コードの変更に隠れたバグや安全でない前提を探せるよう支援します。依頼されたときは、通常の査読を超えた深い検証を行います。
agent-browser
14kエージェントが、実際のブラウザでWebページを検証し、ユーザーに見える内容や操作の結果を確認して、証拠としてスクリーンショットを取れるよう支援します。
creating-plugins
14kエージェントが、安全なフック、ルート、ストレージ、管理画面を備えたEmDash CMS用のプラグインを作れるよう支援します。
emdash-cli
14kエージェントが、コマンドラインからEmDashサイトを管理できるよう支援します。コンテンツ、メディア、メニュー、マイグレーション、サイト全体のエクスポートとインポートを含みます。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。