I'm generating the image using the mb.get_the_post_thumbnail function, but it doesn't provide alt or title attributes.
According to the documentation here https://developer.wordpress.org/reference/functions/get_the_post_thumbnail/
There's an example of someone passing in an array: array( 'class' => 'alignleft' )
I tried something like:
{% set alt_title_array = ["alt=#{post.post_title}", "title=#{post.post_title}"] %}
{% set alttags = alt_title_array|join(' ') %}
And passing alttags as the third attribute, but it doesn't escape the values and thus it's one long string.
Sorry if this is a basic twig question, I'm learning!
Thanks,
AJ