YH-04: Add image: front matter to posts (optional permanent cleanup)
- Source document:
.agents/yahoo-seo-visibility-plan.md(Phase 2 item 1, “we can also run a quick Python script to populateimage:”; §4 table,_posts/*.mdrow) - Owner: 🤖 Agent
- Priority: Low (the runtime fallback already works)
- Status: Not started. The runtime first-
<img>extraction in_includes/head.html(lines ~49–75) is done. Only 2 of 347 posts haveimage:orbackground:front matter. - Depends on: Best done after the MI-* missing-image tasks, so no post points at a missing image.
Task
Write an explicit image: key into each post’s front matter, using the first valid local image in the post body.
Context
head.htmlcurrently usespage.background, thenpage.image, thenpage.header_image, then the first<img src>in the content, then/img/posts/jack-high-bowls-success.png. Explicit front matter is more predictable, and lets other templates (cards, feeds,llms.txt) use the image.- Many image
srcvalues are Liquid expressions, e.g./img/posts/x.png. Extract the literal/img/...path. - Skip images that don’t exist on disk. About 135 references are missing; see the MI-* tasks.
- Keep YAML key order tidy (AGENTS.md:
layout,title,description,date, …). Ask the user whether bumpinglast_modified_atis wanted for a metadata-only change.
Completion criteria
- Every post with at least one valid local image has an
image:key pointing to an existing file. - Built
og:imagevalues are unchanged or improved (spot-check 10 posts). bundle exec jekyll buildcompletes without errors.