Prechádzať zdrojové kódy

feat: support animated GIF in figures

Workaround Hugo converting animated gifs to static gifs: https://github.com/gohugoio/hugo/issues/5030
George Cushen 3 rokov pred
rodič
commit
3ea78d2c66
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      wowchemy/layouts/shortcodes/figure.html

+ 2 - 1
wowchemy/layouts/shortcodes/figure.html

@@ -27,7 +27,8 @@
     <div class="w-100" {{ with .Get "max_width" }}style="max-width: {{.}}"{{end}}>
       {{- if $img -}}
         {{ $isSVG := eq $img.MediaType.SubType "svg" }}
-        {{ if $isSVG -}}
+        {{ $isGIF := eq $img.MediaType.SubType "gif" }}
+        {{ if $isSVG | or $isGIF -}}
           <img alt="{{ $alt }}"
            src="{{ $img.RelPermalink }}"
            loading="lazy"