11ty-website icon indicating copy to clipboard operation
11ty-website copied to clipboard

Document that alt text is required for images

Open squarespirit opened this issue 11 months ago • 2 comments

I think it should be documented more clearly that alt text is required for images, otherwise they will not render. If an image is added without alt text it just doesn't render with a 404 error, which is kind of confusing.

Specifically

  • https://www.11ty.dev/docs/plugins/image/#html-transform. Eleventy will transform any <img> or <picture> tags in HTML files is a false statement, alt text is required
  • The examples in https://www.11ty.dev/docs/plugins/image/#resolving-image-sources are lacking alt text.

squarespirit avatar May 13 '25 01:05 squarespirit

Hi @squarespirit, thanks for pointing this out. This requirement was inherited by the "normal" image plugin, which always had "alt" as a required option.

Maybe we can add a bullet point about "encouraging best practices by requiring alt texts for all images" to the initial bullet point list and/or add an info box to the html transform section.

Snapstromegon avatar May 13 '25 07:05 Snapstromegon

Agreed and have opened an issue on the image plugin itself here

autay27 avatar Jun 07 '25 23:06 autay27