summaryrefslogtreecommitdiff
path: root/layouts/_default/_markup/render-image.html
diff options
context:
space:
mode:
authorReorx <novoreorx@gmail.com>2022-05-20 23:04:58 +0800
committerReorx <novoreorx@gmail.com>2022-05-20 23:04:58 +0800
commit9e54118235ec22d135a2a977349559208dbee35e (patch)
treed807a78d4faed6bda038cdd90739b5d52447f7c8 /layouts/_default/_markup/render-image.html
parent228cf0d83f6972d57c735dac273635a7f022aeac (diff)
warn if image is not found
Diffstat (limited to 'layouts/_default/_markup/render-image.html')
-rw-r--r--layouts/_default/_markup/render-image.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 9c3c9a7..1aa9839 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -4,6 +4,8 @@
{{- $img = resources.Get $path -}}
{{- end -}}
-{{- with $img -}}
+{{- if $img -}}
<img loading="lazy" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} />
+{{- else -}}
+ {{- warnf "No image found for %s from %s" .Destination .Page.File }}
{{- end -}}