Automatic Image Resizing > Partial for Content > Replace


#1

Yesterday, I saw references to using a partial to process content to edit the <img> to add a srcset version using Hugo’s regex engine - replaceRE.

Quite a cool idea, and I want to implement it - set and forget, and just use markdown normally.

However, after spending hours today trying to find those references again, I can’t!

I am using an image section folder, not page resources - if that matters.

Can anyone help me out or point me in the right direction?

Thank you.


#2

What have you tried so far?


#3

Hi @zwbetz.
Sorry for the delay, and I am out walking my dog.
Basically, not much - I am no coder.
I’ve used a partial to output content.
I am using a replace to manipulate the img element.
I am selecting originals from my images folder.
But I suck at regex and go, and these parts aren’t working together yet - plus more parts are needed.
I play at it when I have time.
I am sure some of the efforts here could do it in like 5 minutes - but that’s not me!