da-content

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

DA + EDS content reference

DA + EDS 内容参考

A reference skill — not a workflow. Use it whenever you need to know what the rules are for generating, uploading, or delivering content through Adobe Document Authoring (DA) and Edge Delivery Services (EDS).
This skill consolidates rules from three primary surfaces. Load the reference for the task at hand:
DoingRead
Generating HTML for DA uploadreferences/html-content.md
Uploading images, video, PDFs, fontsreferences/media.md
Hitting the DA admin API, auth, preview/publishreferences/platform.md
Re-verifying asset boundary behavior empiricallyreferences/fixtures/README.md
Every factual claim in the references is tagged
[verified]
(read from code or observed empirically) or
[assumed]
(inferred from documentation without direct verification).
这是一份参考技能,而非工作流。当你需要了解通过Adobe Document Authoring(DA)和Edge Delivery Services(EDS)生成、上传或交付内容的规则时,即可使用本技能。
本技能整合了三个核心层面的规则。根据手头任务加载对应的参考文档:
操作参考文档
生成用于DA上传的HTMLreferences/html-content.md
上传图片、视频、PDF、字体references/media.md
调用DA admin API、认证、预览/发布references/platform.md
实证验证资源边界行为references/fixtures/README.md
参考文档中的所有事实声明都标记为
[verified]
(从代码读取或实证观察)或
[assumed]
(从文档推断,未直接验证)。

When to use this skill

何时使用本技能

Invoke this skill whenever you are:
  • Generating HTML that will be uploaded to DA (
    admin.da.live/source/...
    ).
  • Uploading any binary (PNG, JPG, SVG, MP4, PDF, WOFF2) to DA.
  • Calling
    admin.da.live
    (Source API) or
    admin.hlx.page
    (preview / publish API) directly.
  • Reading a DA-stored HTML document and modifying it before re-upload.
  • Diagnosing why a generated page renders incorrectly on
    aem.page
    /
    aem.live
    (silent failures:
    about:error
    images, missing meta tags, blocks rendering as plain HTML without their JS or CSS).
在以下场景中调用本技能:
  • 生成将上传至DA的HTML(
    admin.da.live/source/...
    )。
  • 向DA上传任何二进制文件(PNG、JPG、SVG、MP4、PDF、WOFF2)。
  • 直接调用
    admin.da.live
    (Source API)或
    admin.hlx.page
    (预览/发布API)。
  • 读取DA存储的HTML文档并修改后重新上传。
  • 诊断生成的页面为何在
    aem.page
    /
    aem.live
    上渲染异常(静默失败:
    about:error
    图片、缺失元标签、区块以纯HTML形式渲染而无对应的JS或CSS)。

When NOT to use this skill

何时不使用本技能

  • Writing block JS or CSS for a project — use building-blocks. This skill covers the content side, not the code side.
  • Universal Editor, structured-content authoring, or AEM Cloud Service (Java / OSGi / JCR). Out of scope.
  • 为项目编写区块JS或CSS —— 使用building-blocks技能。本技能涵盖的是内容层面,而非代码层面。
  • Universal Editor、结构化内容创作或AEM Cloud Service(Java/OSGi/JCR)。这些均超出本技能范围。

Related Skills

相关技能

  • da-auth — Obtain the IMS token needed for every
    admin.da.live
    and
    admin.hlx.page
    call. Invoke before any operation in this skill that needs
    DA_TOKEN
    .
  • generate-import-html — Generates DA-compliant HTML for imported pages; this skill is the rule reference for what that HTML must look like.
  • page-import — Orchestrates full page imports into canonical EDS block format. Reads this skill for the DA-side rules.
  • snowflake — Static-to-EDS overlay conversion. Loads this skill alongside its own methodology for DA HTML and admin API rules.
  • da-auth —— 获取每次调用
    admin.da.live
    admin.hlx.page
    所需的IMS令牌。在本技能中任何需要
    DA_TOKEN
    的操作前调用。
  • generate-import-html —— 生成符合DA规范的导入页面HTML;本技能是该HTML格式规则的参考依据。
  • page-import —— 协调将完整页面导入标准EDS区块格式。读取本技能中的DA端规则。
  • snowflake —— 静态内容到EDS覆盖层的转换。结合自身方法,加载本技能中的DA HTML和admin API规则。

Minimal upload example

最小上传示例

The most common operation — upload an HTML document to DA. Shows the non-obvious rules in one place: multipart/form-data body, field name
data
, blob with
text/html
type, Bearer IMS token, then a separate preview call to make the page reachable at
aem.page
. See references/platform.md for the full contract and references/html-content.md for what the HTML payload must look like.
bash
undefined
最常见的操作 —— 向DA上传HTML文档。将非显而易见的规则集中展示:multipart/form-data请求体、字段名
data
text/html
类型的二进制数据、Bearer IMS令牌,然后单独调用预览接口使页面可在
aem.page
访问。完整协议请见references/platform.md,HTML负载格式要求请见references/html-content.md
bash
undefined

Use $DA_TOKEN from the da-auth skill, or read a cached token file directly.

使用da-auth技能获取的$DA_TOKEN,或直接读取缓存的令牌文件。

See platform.md §3 for the cache locations the various Adobe DA tools use.

请见platform.md第3节了解各类Adobe DA工具使用的缓存位置。

TOKEN="${DA_TOKEN:?invoke the da-auth skill to obtain a DA admin token}"
TOKEN="${DA_TOKEN:?invoke the da-auth skill to obtain a DA admin token}"

1. Upload HTML — note multipart with field name "data" (other names silently fail)

1. 上传HTML —— 注意使用multipart格式且字段名为"data"(其他字段名将静默失败)

curl -X PUT
-H "Authorization: Bearer $TOKEN"
-F "data=@./page.html;type=text/html"
"https://admin.da.live/source/{org}/{repo}/path/to/page.html"
curl -X PUT
-H "Authorization: Bearer $TOKEN"
-F "data=@./page.html;type=text/html"
"https://admin.da.live/source/{org}/{repo}/path/to/page.html"

2. Trigger preview — required separate step, path WITHOUT .html extension

2. 触发预览 —— 这是必需的单独步骤,路径不包含.html扩展名

curl -X POST
-H "Authorization: Bearer $TOKEN"
"https://admin.hlx.page/preview/{org}/{repo}/main/path/to/page"
curl -X POST
-H "Authorization: Bearer $TOKEN"
"https://admin.hlx.page/preview/{org}/{repo}/main/path/to/page"

3. Optional: publish to aem.live

3. 可选:发布至aem.live

curl -X POST
-H "Authorization: Bearer $TOKEN"
"https://admin.hlx.page/live/{org}/{repo}/main/path/to/page"

Image binaries upload the same way (PUT to `admin.da.live/source/...`)
but do NOT need their own preview/publish call — they're served
directly from `content.da.live` once uploaded. They DO get pulled into
Media Bus (content-addressed, with responsive variants) when a
*document* that references them is previewed — see
[references/media.md §2](./references/media.md) for the asset lifecycle.
curl -X POST
-H "Authorization: Bearer $TOKEN"
"https://admin.hlx.page/live/{org}/{repo}/main/path/to/page"

图片二进制文件的上传方式相同(PUT至`admin.da.live/source/...`),但无需单独调用预览/发布接口 —— 上传后直接从`content.da.live`提供服务。当引用它们的*文档*被预览时,图片会被拉入Media Bus(基于内容寻址,包含响应式变体)—— 请见[references/media.md第2节](./references/media.md)了解资源生命周期。

The 11 silent-failure rules

11条静默失败规则

These rules, if violated, produce broken content without any error from DA, the pipeline, or the renderer. Memorize them; verify them in generated output before upload.
  1. DA HTML is a body fragment. No
    <!DOCTYPE>
    , no
    <html>
    , no
    <head>
    , no
    <script>
    , no
    <style>
    , no inline
    style=
    attributes. The pipeline injects head/scripts/styles from Code Bus at delivery. → html-content.md §1
  2. Block class encodes block identity (canonical div form). The outermost
    <div>
    carries
    class="<block-name> [<variant>…]"
    . The first class token is the block name and resolves to
    /blocks/<name>/<name>.{js,css}
    . For the accepted table-form alternate, the header is
    <tr><td colspan="N">Name</td></tr>
    where
    N
    matches the cell count of the widest content row; single-column blocks may omit
    colspan
    . Misshapen blocks (missing div class, multi-column table missing
    colspan
    , empty header cell) render as plain HTML without block JS or CSS. → html-content.md §3
  3. Block names use alphanumeric + single hyphens only. No underscores, no double dashes, no digit-first names. Variants in div form: extra class tokens after the name (
    class="hero cta center"
    ). Variants in table form: parentheses after the name (
    Hero (cta, center)
    ). Both normalize identically via
    toBlockCSSClassNames
    . → html-content.md §3
  4. Page Metadata block name is exactly
    metadata
    .
    Div form:
    class="metadata"
    (single lowercase token). Table form: header text
    Metadata
    (case-insensitive). Misspellings on either side are silently ignored — no
    <meta>
    tags emitted. → html-content.md §5
  5. <img src>
    URLs must be reachable from EDS preview infrastructure.
    The preview step fetches every
    <img src>
    and
    <source srcset>
    URL, content-hashes the bytes, and stores them in Media Bus — that's how the delivered page gets responsive
    <picture>
    variants. Any URL that doesn't return image bytes (DNS failure, 4xx/5xx, HTML response, timeout > 5s) produces
    <img src="about:error">
    . Host-less paths (repo-relative
    /path/foo.png
    , document-relative
    ./foo.png
    ) also fail because the ingester has nothing to fetch. External URLs work fine and are sideloaded on first preview. → media.md §2, html-content.md §9
  6. Pre-upload binaries only when you need URL stability. Sideloading means you do NOT need to upload an image to DA before referencing it from your HTML — any reachable URL works. Pre-upload (to
    /media/<scope>/<file>
    ) when you want the binary under DA's control: immune to third-party host changes, addressable by a stable
    content.da.live
    URL, and re-fetched into Media Bus on each preview. → media.md §2.5, media.md §13.2
  7. DA Source API requires
    multipart/form-data
    with field name
    data
    .
    Other field names (
    file
    ,
    image
    ) return 200 OK with no file written. → platform.md §2
  8. SVG hard cap is 40 KB. PNG/JPG/AVIF/WEBP cap is 20 MB. MP4 cap is 36 MB. Over-cap SVGs cause the preview POST to fail with
    409 AEM_BACKEND_FETCH_FAILED
    ("Images N have failed validation"); pre-check sizes before upload. → media.md §6.1
  9. Preview / publish is a required separate step. Uploading to DA does NOT make the document visible at
    aem.page
    /
    aem.live
    . POST to
    admin.hlx.page/preview/...
    then
    /live/...
    after upload. → platform.md §6
  10. IMS tokens expire silently with 401 + empty body. Dev tokens last 24 hours. Always pre-flight expiry against
    expires_at
    in the cached token file (
    ~/.aem/da-token.json
    for da-auth,
    .hlx/.da-token.json
    for
    @adobe/aem-cli
    ) before a long upload run. → platform.md §3
  11. Block cell content uses stricter inline-tag normalization than default content. Inside block cells, the pipeline rewrites
    <b>
    /
    <i>
    /
    <s>
    /
    <mark>
    /
    <kbd>
    to their semantic equivalents (
    <strong>
    /
    <em>
    /
    <del>
    /
    <em>
    /
    <code>
    ), strips
    <span>
    and
    <ins>
    , and applies positional rules to
    <br>
    . Visual styling survives the rewrites but CSS selectors targeting the original tags or stripped classes stop matching. Generate cell content using only the §3.9 preserve list to avoid silent reshaping. → html-content.md §3.9
若违反这些规则,会导致内容损坏,但DA、流水线或渲染器不会返回任何错误。请牢记这些规则,并在上传前验证生成的输出是否符合要求。
  1. DA HTML是body片段。不包含
    <!DOCTYPE>
    <html>
    <head>
    <script>
    <style>
    ,也不包含内联
    style=
    属性。交付时,流水线会从Code Bus注入头部/脚本/样式。 → html-content.md第1节
  2. 区块类名编码区块标识(标准div形式)。最外层
    <div>
    带有
    class="<block-name> [<variant>…]"
    。第一个类名是区块名称,对应
    /blocks/<name>/<name>.{js,css}
    。对于兼容的表格替代形式,表头为
    <tr><td colspan="N">Name</td></tr>
    ,其中
    N
    与最宽内容行的单元格数量匹配;单列区块可省略
    colspan
    。格式错误的区块(缺失div类名、多列表格缺失
    colspan
    、表头单元格为空)会以纯HTML形式渲染,无区块JS或CSS。 → html-content.md第3节
  3. 区块名称仅使用字母数字+单个连字符。不允许下划线、双连字符、以数字开头的名称。div形式的变体:名称后的额外类名(
    class="hero cta center"
    )。表格形式的变体:名称后的括号(
    Hero (cta, center)
    )。两者通过
    toBlockCSSClassNames
    方法规范化为相同格式。 → html-content.md第3节
  4. 页面元数据区块名称必须为
    metadata
    。div形式:
    class="metadata"
    (单个小写标识)。表格形式:表头文本
    Metadata
    (大小写不敏感)。任何拼写错误都会被静默忽略 —— 不会生成
    <meta>
    标签。 → html-content.md第5节
  5. <img src>
    URL必须能从EDS预览基础设施访问
    。预览步骤会获取每个
    <img src>
    <source srcset>
    的URL,对字节内容进行哈希处理,并存储到Media Bus —— 这是交付页面获得响应式
    <picture>
    变体的方式。任何无法返回图片字节的URL(DNS失败、4xx/5xx错误、HTML响应、超时>5秒)都会生成
    <img src="about:error">
    。无主机路径(仓库相对路径
    /path/foo.png
    、文档相对路径
    ./foo.png
    )也会失败,因为摄取器无法获取内容。外部URL可正常工作,并在首次预览时被侧载。 → media.md第2节html-content.md第9节
  6. 仅当需要URL稳定性时才预上传二进制文件。侧载意味着你无需先将图片上传至DA再在HTML中引用 —— 任何可访问的URL均可使用。当你希望二进制文件受DA控制时(不受第三方主机变更影响、可通过稳定的
    content.da.live
    URL访问、每次预览时重新拉入Media Bus),预上传至
    /media/<scope>/<file>
    。 → media.md第2.5节media.md第13.2节
  7. DA Source API要求使用
    multipart/form-data
    格式且字段名为
    data
    。其他字段名(
    file
    image
    )会返回200 OK,但不会写入文件。 → platform.md第2节
  8. SVG大小上限为40 KB。PNG/JPG/AVIF/WEBP上限为20 MB。MP4上限为36 MB。超过大小上限的SVG会导致预览POST请求失败,返回
    409 AEM_BACKEND_FETCH_FAILED
    ("Images N have failed validation");上传前请预先检查文件大小。 → media.md第6.1节
  9. 预览/发布是必需的单独步骤。上传至DA不会使文档在
    aem.page
    /
    aem.live
    上可见。上传后需POST至
    admin.hlx.page/preview/...
    ,然后再POST至
    /live/...
    。 → platform.md第6节
  10. IMS令牌会静默过期,返回401+空响应体。开发令牌有效期为24小时。在长时间上传运行前,务必根据缓存令牌文件(da-auth技能使用
    ~/.aem/da-token.json
    @adobe/aem-cli
    工具使用
    .hlx/.da-token.json
    )中的
    expires_at
    预检查是否过期。 → platform.md第3节
  11. 区块单元格内容比默认内容使用更严格的内联标签规范化。在区块单元格内,流水线会将
    <b>
    /
    <i>
    /
    <s>
    /
    <mark>
    /
    <kbd>
    重写为对应的语义标签(
    <strong>
    /
    <em>
    /
    <del>
    /
    <em>
    /
    <code>
    ),移除
    <span>
    <ins>
    ,并对
    <br>
    应用位置规则。视觉样式会保留,但针对原始标签或已移除类名的CSS选择器将不再匹配。请仅使用第3.9节中的保留标签生成单元格内容,避免静默格式重塑。 → html-content.md第3.9节

Glossary

术语表

Terms used across all three references.
  • Admin API
    https://admin.hlx.page/<action>/...
    endpoint family. Controls document lifecycle (preview, publish, status). Distinct from the DA Source API.
  • Code Bus — files delivered from the git-tracked GitHub branch (typically
    /fonts/
    ,
    /icons/
    ,
    /blocks/
    ,
    /scripts/
    ,
    /styles/
    ,
    /head.html
    ). Updated by code deploy.
  • Content Bus — files delivered from DA at their original path (SVG, PDF, HTML, JSON, ICO, WOFF2). Updated by preview/publish.
  • DA editor — the web UI at
    https://da.live/edit#/...
    for human authoring of documents.
  • DA Source API
    https://admin.da.live/source/...
    endpoint for read/write of DA-tracked files (HTML and binaries).
  • Default content — anything in an EDS page outside a block: headings, paragraphs, lists, links, images. Renders as standard HTML.
  • Dot-folder
    /<parent>/.<docname>/
    folder created automatically by the DA editor for per-document author uploads of images.
  • EDS — Edge Delivery Services. The rendering pipeline that serves
    aem.page
    (preview) and
    aem.live
    (production), consuming DA content
    • Code Bus + Media Bus.
  • IMS token — Adobe Identity Management access token. Cached at
    ~/.aem/da-token.json
    (via the da-auth skill) or
    .hlx/.da-token.json
    (via the
    @adobe/aem-cli
    tool). Used for auth against the DA Source API and the Admin API.
  • Media Bus — content-addressed backend for image and video binaries (PNG, JPG, AVIF, WEBP, MP4). Dedup by SHA hash; permanent cache.
  • /media
    folder
    — top-level DA folder convention for shared binaries referenced across documents/branches/iterations. Auto-creates on first PUT.
  • Preview / Publish — Admin API operations that promote a document from "stored in DA" to "available at
    aem.page
    " (preview) or "available at
    aem.live
    " (publish).
  • Section — a
    <div>
    directly inside
    <main>
    in a DA HTML document. Becomes
    <div class="section">
    after decoration.
  • Section Metadata — block whose
    Style
    key adds CSS classes to the enclosing section. NOT for SEO metadata (that's Page Metadata).
  • Page Metadata — block whose key/value rows become
    <head>
    <meta>
    tags at delivery. One per page; conventionally last in document.
所有参考文档中使用的术语。
  • Admin API ——
    https://admin.hlx.page/<action>/...
    端点系列。控制文档生命周期(预览、发布、状态)。与DA Source API不同。
  • Code Bus —— 从Git跟踪的GitHub分支交付的文件(通常为
    /fonts/
    /icons/
    /blocks/
    /scripts/
    /styles/
    /head.html
    )。通过代码部署更新。
  • Content Bus —— 从DA按原始路径交付的文件(SVG、PDF、HTML、JSON、ICO、WOFF2)。通过预览/发布更新。
  • DA editor —— 位于
    https://da.live/edit#/...
    的Web UI,用于人工创作文档。
  • DA Source API ——
    https://admin.da.live/source/...
    端点,用于读写DA跟踪的文件(HTML和二进制文件)。
  • Default content —— EDS页面中区块之外的任何内容:标题、段落、列表、链接、图片。以标准HTML形式渲染。
  • Dot-folder —— DA编辑器自动创建的
    /<parent>/.<docname>/
    文件夹,用于每个文档的作者上传图片。
  • EDS —— Edge Delivery Services。提供
    aem.page
    (预览)和
    aem.live
    (生产)服务的渲染流水线,消耗DA内容+Code Bus+Media Bus。
  • IMS token —— Adobe Identity Management访问令牌。缓存于
    ~/.aem/da-token.json
    (通过da-auth技能)或
    .hlx/.da-token.json
    (通过
    @adobe/aem-cli
    工具)。用于DA Source API和Admin API的认证。
  • Media Bus —— 基于内容寻址的图片和视频二进制文件(PNG、JPG、AVIF、WEBP、MP4)后端。通过SHA哈希去重;永久缓存。
  • /media
    folder
    —— DA顶层文件夹约定,用于跨文档/分支/迭代引用的共享二进制文件。首次PUT时自动创建。
  • Preview / Publish —— Admin API操作,将文档从“存储于DA”提升至“可在
    aem.page
    访问”(预览)或“可在
    aem.live
    访问”(发布)。
  • Section —— DA HTML文档中直接位于
    <main>
    内的
    <div>
    。装饰后变为
    <div class="section">
  • Section Metadata —— 其
    Style
    键为包含它的章节添加CSS类的区块。不用于SEO元数据(SEO元数据属于Page Metadata)。
  • Page Metadata —— 其键值行在交付时变为
    <head>
    中的
    <meta>
    标签的区块。每页一个;通常位于文档末尾。