Preview Import

adobe/skills/plugins/aem/edge-delivery-services/skills/preview-import

作者 adobe940b8795c0dfApache-2.0197 個星標收錄於 2026年10月9日更新於 2026年10月8日儲存庫今天更新

Use this when you need to preview and verify content you imported into a local AEM Edge Delivery Services (EDS, Franklin, Helix) dev server on localhost. Starts the dev server against the imported HTML, checks block rendering, inspects DOM structure, compares against the original page, and troubleshoots broken references and 404s.

AI 產生的概覽

在本機 AEM Edge Delivery Services 開發伺服器中預覽並核對匯入的 HTML 內容,與原始頁面進行比對。

功能
此技能會引導代理使用 aem up 指令並搭配 --html-folder 參數,針對匯入的 HTML 啟動本機 AEM Edge Delivery Services(Franklin/Helix)開發伺服器。內容涵蓋前往預覽網址、檢查區塊轉譯、DOM 結構、圖片、中繼資料與區塊樣式,並與原始頁面截圖進行比對。同時提供參照失效、圖片缺漏、原始 HTML 外露與 404 錯誤的疑難排解步驟。
適用情境
適用於已從匯入頁面產生 HTML、準備在瀏覽器中預覽並核對轉譯結果時。用於將本機預覽與原始頁面結構進行比對,以及排解本機開發伺服器中的轉譯問題或 404 錯誤。
執行需求
需要 AEM CLI(aem up)與本機 AEM Edge Delivery Services 專案,以及匯入的 HTML 檔案、images 資料夾、擷取步驟產生的 screenshot.png,還有包含路徑資訊的 metadata.json。此技能未附帶指令碼,僅為操作說明。

Preview Import

Open and verify imported content in local development server.

When to Use This Skill

Use this skill when:

  • You have generated HTML file (from generate-import-html)
  • Ready to preview in browser and verify rendering
  • Need to compare with original page structure

Invoked by: page-import skill (Step 5)

Prerequisites

From previous skills, you need:

  • ✅ HTML file at correct path (from generate-import-html)
  • ✅ Images folder in same directory
  • ✅ screenshot.png from scrape-webpage (for comparison)
  • ✅ documentPath from metadata.json (for URL construction)

Related Skills

  • page-import - Orchestrator that invokes this skill
  • generate-import-html - Provides HTML file to preview
  • scrape-webpage - Provides screenshot for comparison

Preview Workflow

Step 1: Start Development Server with HTML Folder Flag

Determine the folder from metadata.json:

  • Look at paths.dirPath from metadata.json (e.g., /us)
  • This is the root folder containing your imported HTML file

Command:

bash
aem up --html-folder {dirPath}

Examples based on imported content location:

HTML File LocationCommandPreview URL
us/en.plain.htmlaem up --html-folder ushttp://localhost:3000/us/en
products/widget.plain.htmlaem up --html-folder productshttp://localhost:3000/products/widget
blog/2024/post.plain.htmlaem up --html-folder bloghttp://localhost:3000/blog/2024/post

Why this is required:

  • Without --html-folder, AEM CLI proxies requests to the remote server
  • The remote server doesn't have your locally imported content
  • Result: 404 "Page not found" errors

Step 2: Navigate in Browser

For most files, use the document path directly:

http://localhost:3000${documentPath}

Example:

  • HTML file: us/en/about.plain.html
  • URL: http://localhost:3000/us/en/about

IMPORTANT: For index files, use / instead of /index:

If file is: index.plain.htmlPreview at: http://localhost:3000/NOT: http://localhost:3000/index

Note: If you used --html-folder flag (e.g., aem up --html-folder drafts), prepend that folder to the URL:

File: drafts/test.plain.htmlURL: http://localhost:3000/drafts/test

Use paths.documentPath from metadata.json, but for index files ensure the path is / not /index


Step 3: Verify Rendering

Check the following:

  • ✅ Blocks render with correct styling
  • ✅ Layout matches original page structure (compare to screenshot.png)
  • ✅ Images load (or show appropriate placeholders)
  • ✅ No raw HTML visible
  • ✅ Metadata appears in page source (view source, check <meta> tags)
  • ✅ Section styling applied correctly

Step 4: Compare with Original

Side-by-side comparison:

  1. Open ./import-work/screenshot.png alongside browser preview
  2. Check that content structure matches
  3. Verify blocks decorated correctly
  4. Confirm section boundaries align
  5. Validate styling consistency

Troubleshooting

Blocks don't render correctly:

  • Check HTML structure matches expected format
  • Verify block names match exactly (case-sensitive)
  • Review ../content-driven-development/references/html-structure.md for format guidance

Images not loading:

  • Verify images folder is in same directory as HTML file
  • Check image paths are ./images/... format
  • Ensure images were copied correctly from ./import-work/images/

Raw HTML visible:

  • Block name might not match existing block in project
  • Check browser console for JavaScript errors
  • Verify block exists in blocks/ directory

Metadata not in page source:

  • Check metadata block is at end of HTML file
  • View page source and search for <meta> tags in <head>
  • Verify metadata properties match expected format

Dev server not running:

  • Start server with aem up
  • Check for port conflicts (default 3000)
  • Verify you're in correct project directory

Page not found (404):

  • Most common cause: Missing --html-folder flag - restart server with aem up --html-folder {dirPath}
  • Verify HTML file exists at expected path
  • Check documentPath from metadata.json matches URL
  • For index files, use / not /index
  • Check terminal output confirms "Serving HTML files from folder: {folder}"

Output

This skill provides:

  • ✅ Verified preview that matches original page structure
  • ✅ Visual confirmation of correct rendering
  • ✅ Validated block decoration
  • ✅ Confirmed metadata presence

Import complete when all verification points pass.

來源與署名

來源:adobe/skills位於plugins/aem/edge-delivery-services/skills/preview-import提交940b879

授權條款: Apache-2.0

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架