summaryrefslogtreecommitdiff
path: root/layouts/_default
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/_default')
-rw-r--r--layouts/_default/_markup/render-image.html10
1 files changed, 9 insertions, 1 deletions
diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html
index 1acb87d..9c3c9a7 100644
--- a/layouts/_default/_markup/render-image.html
+++ b/layouts/_default/_markup/render-image.html
@@ -1 +1,9 @@
-<img loading="lazy" src="{{ .Destination | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}" {{ end }} />
+{{- $img := .Page.Resources.GetMatch .Destination -}}
+{{- if and (not $img) .Page.File -}}
+ {{ $path := path.Join .Page.File.Dir .Destination }}
+ {{- $img = resources.Get $path -}}
+{{- end -}}
+
+{{- with $img -}}
+ <img loading="lazy" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" {{ with $.Title}} title="{{ . }}" {{ end }} />
+{{- end -}}