wordpress-theme-to-emdash

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Port a WordPress theme to EmDash

将 WordPress 主题移植到 EmDash

Recreate the theme's relevant layouts and interactions as an Astro site backed by EmDash. Preserve the user's requested visual fidelity and feature scope; do not assume every WordPress template or demo feature belongs in the port.
Load building-emdash-site for current EmDash schema, query, rendering, caching, and seed patterns. When a live reference site is available, use the
agent-browser
CLI for rendered comparison; run
agent-browser skills get core --full
for its command reference.
使用 EmDash 作为后端,重新创建主题中相关的布局和交互,构建 Astro 站点。保持用户要求的视觉还原度和功能范围;不要默认每个 WordPress 模板或演示功能都需要移植。
加载 building-emdash-site,以了解当前的 EmDash schema、query、rendering、caching 和 seed 模式。如果可以使用在线参考站点,请使用
agent-browser
CLI 对渲染结果进行比较;运行
agent-browser skills get core --full
查看命令参考。

Choose the evidence

选择依据

Use the best available sources in this order:
  1. theme source and
    theme.json
    , stylesheets, templates, and
    functions.php
    ;
  2. a live demo at representative desktop and mobile viewports;
  3. screenshots or design files supplied by the user;
  4. explicit design decisions where the source is ambiguous.
Do not infer that demo content or images share the theme code's license. Reuse an asset only when its license or the user's rights permit it; otherwise use a clearly licensed substitute with similar dimensions and visual weight.
按以下顺序使用现有条件最好的来源:
  1. 主题源码以及
    theme.json
    、样式表、模板和
    functions.php
    ;
  2. 在具有代表性的桌面端和移动端 viewport 下运行的在线演示;
  3. 用户提供的截图或设计文件;
  4. 当源码存在歧义时,明确的设计决策。
不要推断演示内容或图片与主题代码采用相同的许可证。只有在资源许可证或用户权利允许时才能复用该资源;否则应使用许可证明确、尺寸和视觉分量相近的替代资源。

Plan the port

规划移植

Inventory only the page types, components, responsive states, and interactions needed for the requested site. Map WordPress responsibilities before implementing:
  • PHP templates become Astro routes, layouts, and components.
  • Custom post types, metadata, and taxonomies become EmDash collections, fields, and taxonomies.
  • Theme Customizer values become site settings or explicit project configuration.
  • Menu locations become named EmDash menus queried by templates.
  • Sidebars and widgets become widget areas or ordinary Astro components.
  • Shortcodes and plugin-owned behavior may require a separate plugin migration.
Read WordPress theme concept mapping when translating template hierarchy,
functions.php
registrations, template tags, hooks, widgets, or reusable blocks.
Dynamic EmDash content routes must remain server-rendered. Use the EmDash
Image
component for EmDash media fields; ordinary theme assets can use Astro's asset handling.
仅清点所需站点涉及的页面类型、组件、响应式状态和交互。实现之前,先映射 WordPress 中的各项职责:
  • PHP 模板转换为 Astro routes、layouts 和 components。
  • Custom post types、metadata 和 taxonomies 转换为 EmDash collections、fields 和 taxonomies。
  • Theme Customizer 配置项转换为站点设置或明确的项目配置。
  • Menu locations 转换为具名的 EmDash menus,由模板进行查询。
  • Sidebars 和 widgets 转换为 widget areas 或普通 Astro components。
  • Shortcodes 和插件拥有的行为可能需要单独进行插件迁移。
在转换模板层级、
functions.php
注册项、template tags、hooks、widgets 或 reusable blocks 时,请阅读 WordPress 主题概念映射。
动态 EmDash 内容 routes 必须保持 server-rendered。EmDash 媒体字段应使用 EmDash
Image
component;普通主题资源可以使用 Astro 的资源处理机制。

Work in scoped phases

按范围划分阶段

Read a phase file only when that phase applies:
  • Discovery and reference capture
  • Design extraction
  • Template conversion
  • Dynamic EmDash features
  • Schema and seed data
  • Rendered verification
When creating a standalone theme project, start from the repository's current site template or the user's existing project. Confirm the destination before writing and do not replace an existing site structure without explicit direction.
仅在相应阶段适用时读取阶段文件:
  • 发现与参考捕获
  • 设计提取
  • 模板转换
  • 动态 EmDash 功能
  • Schema 与 seed 数据
  • 渲染验证
创建独立主题项目时,应从仓库当前的站点模板或用户现有项目开始。写入前确认目标目录,未经明确指示不要替换现有站点结构。

Verify the result

验证结果

Build the site and exercise each in-scope page and interaction. Compare matched viewports against the reference, including responsive navigation, content with long and missing values, RTL when admin or theme behavior depends on direction, and relevant empty or error states.
Capture before-and-after or reference-and-result screenshots when visual fidelity is part of acceptance. Report deliberate deviations, missing source evidence, unsupported WordPress behavior, and asset substitutions.
构建站点,并逐一测试范围内的每个页面和交互。在相同的 viewport 下将结果与参考站点进行比较,包括响应式导航、超长或缺失内容、依赖方向的管理端或主题行为所涉及的 RTL,以及相关的空状态或错误状态。
如果视觉还原度属于验收标准,请捕获移植前后或参考与结果之间的截图。报告有意做出的偏差、缺失的源码依据、不受支持的 WordPress 行为以及资源替换情况。

Licensing and attribution

许可与署名

Inspect the source theme's actual license and notices. Preserve required copyright and attribution, include the applicable license text for reused code, and identify third-party assets separately. Do not label a port GPL-2.0-or-later merely because the source is a WordPress theme.
检查源主题的实际许可证和声明。保留必须包含的版权信息和署名,对复用的代码包含适用的许可证文本,并单独标明第三方资源。不要仅因为源项目是 WordPress 主题,就将移植作品标记为 GPL-2.0-or-later。