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

github.com/chipzoller/hugo-clarity.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Boothe <git@rootwork.org>2022-05-17 23:47:56 +0300
committerIvan Boothe <git@rootwork.org>2022-05-17 23:47:56 +0300
commita16cb00f07a777e35e5f751cfdfab5e123aa339e (patch)
tree502e724f8c130a7c911abe93c2bb58c1ada8f86c
parent7b8a2ac27c66be4852c2e5d7dd1d7d145f90007d (diff)
ensure builds won't choke on broken images
Signed-off-by: Ivan Boothe <git@rootwork.org>
-rw-r--r--layouts/_default/_markup/render-image.html2
-rw-r--r--layouts/partials/image.html2
2 files changed, 2 insertions, 2 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index bc18a77..3094c79 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -18,7 +18,7 @@
{{- if strings.HasPrefix $file "http" -}}
{{- $scratch.Add "classes" " image_external" -}}
{{- $image = resources.GetRemote $file -}}
- {{- with $image.MediaType }}
+ {{- with $image }}
{{- if eq $image.MediaType.MainType "image" -}}
{{- if eq $image.MediaType.SubType "svg" -}}
{{- $image = "" -}}
diff --git a/layouts/partials/image.html b/layouts/partials/image.html
index 3b10854..469b116 100644
--- a/layouts/partials/image.html
+++ b/layouts/partials/image.html
@@ -28,7 +28,7 @@
{{- if strings.HasPrefix $file "http" -}}
{{- $scratch.Add "classes" " image_external" -}}
{{- $image = resources.GetRemote $file -}}
- {{- with $image.MediaType }}
+ {{- with $image }}
{{- if eq $image.MediaType.MainType "image" -}}
{{- if eq $image.MediaType.SubType "svg" -}}
{{- $image = "" -}}