eleventy-img icon indicating copy to clipboard operation
eleventy-img copied to clipboard

Does eleventy-img have a callback for each transformation?

Open Nooshu opened this issue 4 months ago • 0 comments

The plugin is working extremely well, thanks so much for all your hard work! It's so much easier to use the standard Markdown for inserting images into blog posts.

I'd like to be able to edit the outputted HTML before it gets output to the page. I plan to wrap the <picture> element in a <figure> and insert a <figcaption> as well.

There may already be a way to do this? If so, then this issue can likely be closed!

My idea was to have a callback that is called for every transformation and the data passed into the callback would be the transformed HTML, which could then be manipulated using standard string manipulation etc. This would modify the HTML for every <picture> element before it is rendered to the page.

Is there an easier option than this already available?

Nooshu avatar Oct 05 '24 23:10 Nooshu