warn if image is not found

This commit is contained in:
Reorx 2022-05-20 23:04:58 +08:00
parent 228cf0d83f
commit 9e54118235
1 changed files with 3 additions and 1 deletions

View File

@ -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 -}}