Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/asurbernardo/amperage.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAsur <asur@asurbernardo.com>2020-04-25 16:03:13 +0300
committerAsur <asur@asurbernardo.com>2020-04-25 16:03:13 +0300
commit70922be05921644558d117324674104b69264935 (patch)
tree5da3a30aad07756db79851fbdf1d0a8451d1e284
parent123593ee0431ecb9a921ca0caffda5acc1a952fa (diff)
Improve resource type detection for image resizing
-rw-r--r--layouts/partials/blocks/image.html3
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,