I’m looking at that feature and trying to change the image format to serve it to the user.
In Ghost 5.7.0, we updated the functionality of the img_url helper: it now can convert image formats automatically! This update is perfect for theme developers who are serious about performance
Why it’s important
Images are the heaviest part of your website. The new helper automatically converts an image from PNG, GIF, or JPEG to WebP, which reduces its size by ~25% without any visible loss of quality. Using the new helper will make your website faster, positively impact SEO, and …
I modified the img_url that exists in the hbs file of the theme as suggested in the guide, and in that case, it is being sent to the user as an avif file or webp file as normal.
However, it doesn’t seem to work for images added via the editor (both snippet and pasting images from the editor).
I have not been able to find any relevant information or code on this either.
How is it possible to send webp, avif conversion even for images located in content? Is there a separate hbs file for figure kg-image-card?
Theme : Casper
Images added via the editor are automatically served compressed and responsively (that is, different sizes for different screen sizes). They aren’t served via different formats, though.
img_url helper is only for images used by the theme, not images used in the editor.
I looked it up a bit more while you were answering, and it looks like that part is handled by koeing editor, so sadly it would be difficult to handle separately. and can not use
img_url helper in this section.
Thank you for reply.