markdown-folder-to-html icon indicating copy to clipboard operation
markdown-folder-to-html copied to clipboard

Ability to add captions

Open struffel opened this issue 3 years ago • 0 comments

I would like to display the alt tags of an image as captions in HTML. My current solution is to add this code to the template.html:

<script>
      document.querySelectorAll('article img').forEach( img => img.outerHTML = `<figure>${img.outerHTML}<caption>${img.alt}</figcaption></figure>`);
</script>

This does work (if JS is enabled) but it would be nice to have a built-in option for generating images as proper figures when building the pages instead of having to do it client-side.

struffel avatar Dec 19 '21 19:12 struffel