wordpress-theme-to-emdash
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWordPress Theme to EmDash
将WordPress主题迁移至EmDash
Port WordPress themes to EmDash in six phases. Read the phase file before starting each phase.
分六个阶段将WordPress主题迁移至EmDash。开始每个阶段前,请阅读对应阶段的文件。
Critical Rules
核心规则
- Copy scaffold first - Start every theme by copying from this skill
scaffold/ - Take screenshots of demo - Identify the demo URL and capture all page types using agent-browser before starting work
- No hard-coded content - Use for title/tagline,
getSiteSettings()for navigationgetMenu() - Server-rendered pages - Never use for EmDash content
getStaticPaths() - Astro 6 - Use not
ClientRouter, Zod 4 syntax, Node 22+ViewTransitions - Use emdash Image component - For all images, import Image from "emdash/ui"
- 先复制脚手架 - 所有主题开发均需从本skill中复制目录开始
scaffold/ - 截取演示站点截图 - 开始工作前,确定演示站点URL,并使用agent-browser捕获所有页面类型的截图
- 禁止硬编码内容 - 标题/标语使用获取,导航菜单使用
getSiteSettings()获取getMenu() - 服务器渲染页面 - EmDash内容绝不能使用
getStaticPaths() - Astro 6 规范 - 使用而非
ClientRouter,采用Zod 4语法,要求Node 22及以上版本ViewTransitions - 使用EmDash Image组件 - 所有图片均需从"emdash/ui"导入Image组件
Phases
迁移阶段
| Phase | File | Summary |
|---|---|---|
| 1 | | Download theme, screenshot demo, capture images |
| 2 | | Extract CSS variables, fonts, colors |
| 3 | | Convert PHP templates to Astro |
| 4 | | Site settings, menus, taxonomies, widgets |
| 5 | | Create seed file with demo content |
| 6 | | Screenshot, compare, iterate, build |
| 阶段 | 文件 | 概述 |
|---|---|---|
| 1 | | 下载主题、截取演示站点截图、捕获图片素材 |
| 2 | | 提取CSS变量、字体、配色方案 |
| 3 | | 将PHP模板转换为Astro模板 |
| 4 | | 配置站点设置、菜单、分类法、小工具 |
| 5 | | 创建包含演示内容的种子文件 |
| 6 | | 截图、对比、迭代优化、构建站点 |
Checklist
检查清单
Setup
初始化设置
- Copy to new theme directory. Unless otherwise specified by the user, make this a subdirectory of
scaffold/and name it after the WordPress theme (e.g.,themes/).themes/twentytwentyfour/ - Rename folder, update
package.json - Verify build:
pnpm build
- 将复制到新主题目录。除非用户另有指定,否则将其作为
scaffold/的子目录,并以原WordPress主题命名(例如:themes/)。themes/twentytwentyfour/ - 重命名文件夹,更新
package.json - 验证构建:执行
pnpm build
Phase 1: Discovery
阶段1:探索准备
- Theme source downloaded
- Demo site identified
- folder created with
discovery/,screenshots/,images/notes.md - All page types screenshotted
- Sample images downloaded
- 已下载主题源码
- 已确定演示站点
- 已创建目录,包含
discovery/、screenshots/和images/notes.md - 已捕获所有页面类型的截图
- 已下载示例图片素材
Phase 2: Design
阶段2:设计提取
- CSS variables in
global.css - Fonts loading
- Colors match demo
- 已在中配置CSS变量
global.css - 已完成字体加载配置
- 配色与演示站点一致
Phase 3: Templates
阶段3:模板转换
- Homepage, single post, archive, category, tag, page, 404
- Components extracted (PostCard, etc.)
- 已完成首页、单篇文章、归档页、分类页、标签页、自定义页面、404页面的模板转换
- 已提取组件(如PostCard等)
Phase 4: Dynamic
阶段4:动态功能适配
- Site settings (title, tagline, logo from CMS)
- Navigation menus (from CMS, not hard-coded)
- Taxonomies
- Widget areas (if applicable)
- 已配置站点设置(从CMS获取标题、标语、Logo)
- 已配置导航菜单(从CMS获取,非硬编码)
- 已配置分类法
- 已配置小工具区域(如适用)
Phase 5: Seed
阶段5:种子文件创建
- Seed file created with demo images at (or wired up via
.emdash/seed.json)package.json#emdash.seed
- 已在创建包含演示图片的种子文件(或通过
.emdash/seed.json配置)package.json#emdash.seed
Phase 6: Verify
阶段6:验证与收尾
- Dev server applied seed cleanly on first request (no validation errors in logs)
- Output screenshots captured
- Visual comparison done
- Build succeeds:
pnpm build - LICENSE file downloaded (GPL-2.0 in most cases)
- README credits original theme
- 开发服务器首次请求时可正常加载种子数据(日志中无验证错误)
- 已捕获输出站点的截图
- 已完成视觉对比
- 构建成功:执行无报错
pnpm build - 已下载LICENSE文件(多数情况下为GPL-2.0)
- README文件中已注明原主题出处
Reference Documents
参考文档
- - Astro 6 patterns
references/astro-essentials.md - - PHP → Astro conversion
references/template-patterns.md - - WP → EmDash concepts
references/concept-mapping.md - - Full API reference
references/emdash-api.md - - CSS extraction techniques
references/design-extraction.md
- - Astro 6 设计模式
references/astro-essentials.md - - PHP 转 Astro 模板指南
references/template-patterns.md - - WordPress 转 EmDash 概念映射
references/concept-mapping.md - - 完整API参考文档
references/emdash-api.md - - CSS提取技巧
references/design-extraction.md