diff options
| author | Reorx <novoreorx@gmail.com> | 2022-05-20 23:04:58 +0800 |
|---|---|---|
| committer | Reorx <novoreorx@gmail.com> | 2022-05-20 23:04:58 +0800 |
| commit | 9e54118235ec22d135a2a977349559208dbee35e (patch) | |
| tree | d807a78d4faed6bda038cdd90739b5d52447f7c8 | |
| parent | 228cf0d83f6972d57c735dac273635a7f022aeac (diff) | |
warn if image is not found
| -rw-r--r-- | layouts/_default/_markup/render-image.html | 4 |
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 -}} |
