用途:从 HTML 模板批量生成 Etsy 商品列表图片,通过 Playwright 截图渲染输出 PNG。
主要能力:支持单张与批量渲染;模板为普通 HTML,渲染时替换占位符 PRODUCT_IMAGE_URL、TITLE_TEXT、SUBTITLE_TEXT、BADGE_LEFT_TEXT,右侧徽章 INSTANT DOWNLOAD 为硬编码,需改 HTML 才能变更。默认模板 puppet-listing.html 为 1400×2000 竖版,白底、鼠尾草绿(#4D6840)底部横幅、金色胶囊徽章、Poppins 字体,产品图使用 object-fit: cover 与 object-position: center center,并带 TheSunDaisy 水印。
使用方式:单张运行 node scripts/render.mjs <template> <image-url> <title> <subtitle> <badge> <output>;批量先建 JSON 数组(字段 file/image/url 必填,title、subtitle/name、badge、output 可选,output 默认由 subtitle 自动生成),再运行 node scripts/render.mjs --batch assets/puppet-listing.html stories.json output/listings/。本地图片可通过 Image Forge 后端(复制到 /projects/image-forge/output/,经 http://localhost:3021/api/output/文件名.png 访问)、file:// 绝对路径或本地 HTTP 服务器提供。
依赖:Node.js 与 Playwright(未安装时执行 npx playwright install chromium)。
限制:右侧徽章文字不可通过参数修改;模板尺寸、配色、字体等需自行编辑 HTML/CSS 调整;其余收费、平台支持范围等信息暂未提供。