diff options
-rw-r--r-- | layouts/partials/blocks/image.html | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/layouts/partials/blocks/image.html b/layouts/partials/blocks/image.html index c923e86..522c4b6 100644 --- a/layouts/partials/blocks/image.html +++ b/layouts/partials/blocks/image.html @@ -6,12 +6,11 @@ {{ end }} {{ $resource := resources.Get .src }} {{ with $resource }} - {{ if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") }} + {{ if in (slice "jpeg" "jpg" "png" "gif") $resource.MediaType.SubType }} <amp-img src="{{ .Permalink | absURL }}" - srcset=" - {{ (.Resize "1200x").Permalink }} 1200w, - {{ (.Resize "800x").Permalink }} 800w, + srcset="{{ (.Resize "1200x").Permalink }} 1200w, + {{ (.Resize "900x").Permalink }} 900w, {{ (.Resize "640x").Permalink }} 640w, {{ (.Resize "480x").Permalink }} 480w, {{ (.Resize "320x").Permalink }} 320w @@ -23,6 +22,7 @@ class="figure__image {{ with $.class }}{{ . }}{{ end }} {{ with $.caption }}figure__image--with-caption{{ end }}"> </amp-img> {{ else }} + FOO <amp-img src="{{ .Permalink | absURL }}" width={{ with $.width }} "{{ . }}" {{ else }} {{ .Width }} {{ end }} |