Hello,
If I understand correctly, support for resizing animated GIF images has been supported since Hugo version 0.101.
I wanted to look into this option, but the rendering is nothing more than a conversion to PNG.
Have I misunderstood the function?
Thanks
render-image.html
-----------
{{ if and $image (eq $image.MediaType.SubType "gif") }}
{{ if ge $image.Width "800" }}
{{ $XS := $image.Resize "250x gif" }}
{{ $SM := $image.Resize "300x gif" }}
{{ $MD := $image.Resize "400x gif" }}
{{ $LG := $image.Resize "500x gif" }}
{{ $XL := $image.Resize "700x gif" }}
{{ $XXL := $image.Resize "800x gif" }}
{{ $alt := .PlainText | safeHTML }}
{{ $caption := "" }}
{{ with .Title }}
{{ $caption = . | safeHTML }}
{{ end }}
<figure>
<a href="{{ $image.RelPermalink }}">
<img class="mx-auto d-block"
sizes="(max-width: 400px) 250px,
(max-width: 500px) 300px,
(max-width: 768px) 400px,
(max-width: 992px) 500px,
(max-width: 1440px) 700px,
800px"
srcset="{{ $image.RelPermalink }} 250w,
{{ $image.RelPermalink }} 300w,
{{ $image.RelPermalink }} 400w,
{{ $image.RelPermalink }} 500w,
{{ $image.RelPermalink }} 700w,
{{ $image.RelPermalink }} 800w"
src="{{ $image.RelPermalink }}"
alt="{{ if $alt }}{{ $alt }}{{ else if $caption }}{{ $caption | markdownify | plainify }}{{ else }} {{ end }}"
>
</a>
{{ with $caption }}
<figcaption class="text-center">{{ . | markdownify }}</figcaption>
{{ end }}
</figure>
{{ end }}
----------
Repository GitHub - hacf-admin/blog_hacf at static_cms
But render-image.html is not update with code for gif.