mfg92 / hugo-shortcode-gallery

A theme component with a gallery shortcode for the static site generator hugo.
MIT License
354 stars 66 forks source link

Add support for webp #40

Closed RoneoOrg closed 2 years ago

RoneoOrg commented 2 years ago

Hi there,

webp images doesn't seem to be supported:

Adding a .webp file in the image folder results in this error:

ERROR 2022/04/01 16:04:23 "/home/user/hugo-shortcode-gallery/content/posts/images/index.md:9:1":
failed to render shortcode "gallery": failed to process shortcode: "/home/user/hugo-shortcode-gallery/themes/hugo-shortcode-gallery/layouts/shortcodes/gallery.html:130:30":
execute of template failed: template: shortcodes/gallery.html:130:30:
executing "shortcodes/gallery.html" at <$original.Fit>: error calling Fit: *resources.generic
Resource is not an image
mfg92 commented 2 years ago

webp files are working fine for me. Do you use the extended version of hugo? hugo-extended is needed for webp support (see https://gohugo.io/news/0.83.0-relnotes/).

RoneoOrg commented 2 years ago

webp files are working fine for me. Do you use the extended version of hugo?

Yes, but Hugo 81 extended is not enough. It works fine with Hugo 83 extended. I'm closing this issue. Thanks!

RoneoOrg commented 2 years ago

Related documentation update is pending for review: https://github.com/mfg92/hugo-shortcode-gallery/pull/44