diff options
author | Asur <asur@asurbernardo.com> | 2020-04-25 16:03:13 +0300 |
---|---|---|
committer | Asur <asur@asurbernardo.com> | 2020-04-25 16:03:13 +0300 |
commit | 70922be05921644558d117324674104b69264935 (patch) | |
tree | 5da3a30aad07756db79851fbdf1d0a8451d1e284 | |
parent | 123593ee0431ecb9a921ca0caffda5acc1a952fa (diff) |
Improve resource type detection for image resizing
-rw-r--r-- | layouts/partials/blocks/image.html | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/layouts/partials/blocks/image.html b/layouts/partials/blocks/image.html index 346a817..b7af217 100644 --- a/layouts/partials/blocks/image.html +++ b/layouts/partials/blocks/image.html @@ -1,5 +1,4 @@ <figure class="figure {{ with .caption }}figure--with-caption{{ end }}"> - {{ with .caption }} <figcaption class="figure__caption"> {{ . }} @@ -7,7 +6,7 @@ {{ end }} {{ $resource := resources.Get .src }} {{ with $resource }} - {{ if eq .MediaType "image/jpeg"}} + {{ if and (eq .ResourceType "image") (ne .MediaType.SubType "svg") }} <amp-img src="{{ .Permalink | absURL }}" srcset="{{ (.Resize "1200x").Permalink }} 1200w, |