Defining alt to images=[] front matter

I may be dense and overlooking it, but does Hugo support defining alt when using the images=[] array front matter? This is particularly a concern for web accessibility.

Ideally, I’d imagine it would be something like this:

images=[
    ["img1.png","alt1"],
    ["img2.png","alt2"]
]

or is images=[] really only intended for twitter cards and open graph and not theme use?

It can be done with the appropriate template code

1 Like

Not and function for twitter cards.

images = [["static/img/picture.jpg","test"]]

returns this:

<meta name="twitter:image" content=""/>

rather than this:

<meta name="twitter:image" content="static/img/picture.jpg"/>

EDIT: Beyond the fact that your “answer” is less than helpful (at least link to something or use any word that would help someone search).

Show us the template code you’re using. Then we can go from there.

Internal Twitter Card Template

I see. So you’ll want to copy that internal template code to your own partial. Then you can add in the alt attr logic.