This is how I create images with caption in my Markdown content used in Eleventy.
This image:

Becomes this HTML:
<figure>
<img src="path/to/the/image.jpg" alt="This is the alt text">
<figcaption>This is the <strong>title</strong></figcaption>
</figure>
I use it as a hook after transforming simple images into responsive images with srcset
/sizes
attributes thanks to https://nhoizey.github.io/eleventy-plugin-images-responsiver/