- name
- blog-image-embedder
- description
- Analyze polished zh-CN blog markdown, generate hero + per-section image prompts, embed image placeholders into the markdown, and save updated version.
- author
- Jeff Yang
- version
- 1.0.4
- tags
- ["openclaw","clawhub","blog","images","prompts","embed","markdown"]
- metadata
- {"openclaw":{"requires":[],"platforms":["linux","darwin"]}}
- inputSchema
- {"type":"object","properties":{"imageModel":{"type":"string","default":"openai/gpt-5-mini","enum":["openai/gpt-5-mini","openai/dall-e-3","stability/ai-sdxl"]},"polishedPath":{"type":"string","description":"Path to polished markdown from blog-polish-zhcn","pattern":".*\\.md$"},"outputDir":{"type":"string","default":"~/.openclaw/workspace/contentPolished/"},"style":{"type":"string","default":"clean flat vector illustration, minimal isometric, software-engineering diagram vibe"},"background":{"type":"string","default":"white background with subtle grid"},"aspectRatioHero":{"type":"string","default":"16:9 horizontal"},"aspectRatioSection":{"type":"string","default":"16:9"},"imageWidth":{"type":"integer","default":800,"description":"Width in pixels for hero image"},"imageHeight":{"type":"integer","default":450},"sectionWidth":{"type":"integer","default":800},"imageQuality":{"type":"string","enum":["low","medium","high","ultra"],"default":"medium"},"imageFormat":{"type":"string","enum":["png","jpg","webp"],"default":"png"}},"required":["polishedPath","outputDir"]}
- outputSchema
- {"type":"object","properties":{"illustratedPath":{"type":"string"},"imagePrompts":{"type":"array"},"imagePaths":{"type":"array"}},"required":["illustratedPath","imagePrompts","imagePaths"]}
- workflow
- [{"name":"resolve_latest_polished","description":"Find latest *.md in outputDir","inputs":["outputDir"],"outputs":["polishedPath"],"run":"polishedPath=\"$(ls -t \"$outputDir\"/*.md | head -n 1)\"\nsave_state polishedPath \"$polishedPath\"\n"},{"name":"read_polished","description":"Read polished markdown from disk","inputs":["polishedPath"],"outputs":["markdownContent"],"run":"polishedPath=$(load_state polishedPath)\nmarkdownContent=\"$(cat \"$polishedPath\")\"\nsave_state markdownContent \"$markdownContent\"\n"},{"name":"parse_sections","description":"Extract title and sections from markdown","inputs":["markdownContent"],"outputs":["title","sections"],"llm":true},{"name":"generate_prompts","description":"Generate hero & section images using configured model","inputs":["sections","style","background","imageModel","imageWidth","imageHeight","imageQuality"],"outputs":["imagePrompts","imagePaths"],"image":true,"params":{"model":"${imageModel}","width":"${imageWidth}","height":"${imageHeight}","quality":"${imageQuality}","format":"png"}},{"name":"embed_placeholders","description":"Insert [image:x] placeholders and save illustrated markdown","inputs":["markdownContent","imagePaths","outputDir"],"outputs":["illustratedPath"],"run":"markdownContent=$(load_state markdownContent)\nimagePaths=$(load_state imagePaths)\n# ...apply embedding, write to file...\nts=$(date +\"%y%m%d%H%M\")\nillustratedPath=\"$outputDir/${ts}-illustrated.md\"\nsave_state illustratedPath \"$illustratedPath\"\n"},{"name":"finalize","run":"illustratedPath=$(load_state illustratedPath)\nimagePrompts=$(load_state imagePrompts)\nimagePaths=$(load_state imagePaths)\njq -n --arg illustratedPath \"$illustratedPath\" \\\n --argjson imagePrompts \"$(echo \"$imagePrompts\" | jq -c .)\" \\\n --argjson imagePaths \"$(echo \"$imagePaths\" | jq -c .)\" \\\n '{illustratedPath:$illustratedPath,imagePrompts:$imagePrompts,imagePaths:$imagePaths}'\n"}]