Featured card images have empty alt text
Every featured image renders with an empty alt attribute.
be-best/layouts/_partials/images/featured-image.html:24-25 reads
$image.Params.title and .Params.caption, which come from Hugo image
metadata. No content defines any: grep '^image:' content returns nothing. The
values are therefore always nil, alt="" reaches the markup, and the caption
element in image-variants.html:43 never renders. public/post/index.html and
public/post/garden/index.html each carry 6 empty alt attributes.
Featured card images have empty alt text
- The 44
featured.webpfiles undercontent/each get image metadata: front matter naming the file, withparams.titleandparams.caption. 41 pages gained the block;banana-bread,broccoli-bacon-saladanddate-and-walnut-loafalready had one. - When metadata is missing,
featured-image.htmlfalls back to the page title, soaltis never empty. - A caption renders under the featured image of a post page, and not under a card.
Acceptance Criteria
grep -c 'alt=""' public/post/index.htmlandgrep -c 'alt=""' public/post/garden/index.htmlboth report 0, against 6 today.- Every
<img>written byimage-variants.htmlhas analtequal to the caption in that image’s metadata, and noaltis the empty string on any page inpublic/. pnpm run testpasses, including html-validate.
Notes
The metadata is Hugo page resource config, the form the three existing recipe pages already used, because the partial reads
$image.Params.*off the resource - a top-levelimage:metadata block would not reach it:resources: - src: 'featured.webp' params: title: 'Lemon Bars' # caption under the image caption: 'A photograph of lemon bars.' # alt textPage layouts (
post,recipe,project,profile,about) call the partial with(dict "page" . "caption" true); the four card partials call it with(dict "page" .), so cards get alt text and no caption. Every caller now passes a dict: a page context has nopagekey to read, and a page errors on the missing field, so a bare.cannot be told from a dict.Four section images show something other than their section, tracked as
p1-is-cuisine-images-show-the-wrong-cuisine, and their alt text says what the file shows:recipe/americanandrecipe/australiancarry the same “Pastries” title card,recipe/mexicancarries the “Middle Eastern” one, andrecipe/japanesereuses therecipe/chinesebeef photo.