Hi! I’ve found this incredible article here for image optimization and lazyloading:
Now my issue is that most of my sites are marketing sites where the images are in the layout itself. I would love to be able to do what this does but with partials instead. How can I have a partial that receives an src value just like I would with a shortcode?
I’ll try to be clearer. In that case of the shortcode this guy use, he only has to add this:
{{<post-image image="hero-image.png" />}}
in order for the shortcode to be activated and generating a lazyloaded image that is optimized via srcset. The issue is that we can’t use shortcodes in layout.
I’m trying to get the same result, but by using partial. I would like the variable that I’m passing be the src attribute of <img>