EmDash の記事・ページを REST API で安全に公開する
Publish EmDash content safely via the REST API
EmDash CMS へ下書き作成→読み戻し→最新 _rev で公開→公開ページ検証の流れで記事を投稿。Markdown 崩れや重複投稿、画像設定ミスを防ぎます。
できること
EmDash CMS の REST API(または MCP ツール)で記事・固定ページを作成し、公開まで確実に進めるためのスキルです。
- 下書き作成 → 読み戻し → 最新の
_revで公開 → 公開ページの HTTPS 検証 - Markdown から Portable Text への変換と、表・リンク・HTML ブロックの扱い
- 画像アップロード、アイキャッチ(
featured_image)と OG 画像の正しい設定 - カテゴリ・タグの付与、メニュー項目の追加
- 大量の定型投稿を D1 と R2 に直接書き込んで予約公開する方法
付属の scripts/check_portable_text.py が、送信前のペイロードに残った Markdown 記号、CR 文字、未置換の表プレースホルダーなどを検出します。
使い方
python scripts/check_portable_text.py payload.json
エージェントに「この原稿を EmDash に下書き保存して、確認後に公開して」と依頼すると、スキーマ確認から公開ページの確認まで手順どおりに進めます。
必要な環境
- EmDash サイトと、認証済みの REST API または MCP 接続
- Python 3、Node.js(公式の
markdownToPortableTextを使う場合)
注意点
- 書き込みは自動で再試行しません。曖昧な失敗の後は、ID またはスラッグで現状を確認してから再実行します。
- 本番 D1 への直接書き込みは、バックアップを取ってから行ってください。
English description
Draft, read back, publish with the fresh revision and verify the live page on EmDash CMS, avoiding raw Markdown, duplicates and broken images.
What it does
A skill for creating and publishing posts and pages on EmDash CMS through its REST API (or MCP tools) reliably.
- Draft → read back → publish with the fresh
_rev→ verify the public page over HTTPS - Markdown-to-Portable-Text conversion, including tables, links and HTML blocks
- Image upload and correct
featured_image/ OG image values - Category/tag assignment and menu items
- Bulk scheduled publishing by writing directly to D1 and R2
The bundled scripts/check_portable_text.py catches leftover Markdown markers, CR characters and unreplaced table placeholders before you send a payload.
How to use
python scripts/check_portable_text.py payload.json
Ask your agent "save this draft to EmDash and publish it after checking"; it follows the procedure from schema inspection to public-page verification.
Requirements
- An EmDash site with authenticated REST API or MCP access
- Python 3, and Node.js if you use the official
markdownToPortableText
Notes
- Writes are never retried blindly; after an ambiguous failure the agent looks up the entry by ID or slug first.
- Back up the production D1 database before using the direct-write method.
インストール方法
- ダウンロードしたZIPを展開します(中に
emdash-content-publishing/フォルダとSKILL.mdがあります)。 - フォルダごと、使うエージェントのスキル置き場にコピーします。
- Claude Code:
~/.claude/skills/(プロジェクト単位なら.claude/skills/) - Hermes Agent:
~/.hermes/skills/
- Claude Code:
- エージェントを再起動し、スキル一覧に表示されることを確認します。