aboutsummaryrefslogtreecommitdiff
path: root/layouts/_markup/render-image.html
blob: cd003f3bd2d6b8ce3244d66cc0266ca904eb536df1222972d7373de75c300661 (plain)
1
2
3
4
5
6
7
{{/* .Destination is marked safe below, so scripting schemes are dropped here */ -}}
{{ $scheme := lower (urls.Parse .Destination).Scheme -}}
{{ if in (slice "javascript" "vbscript") $scheme -}}
{{ warnidf "unsafe-image-scheme" "dropped %s: image in %s" $scheme .Page.Path -}}
{{ else -}}
<img src="{{ .Destination | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }} alt="{{ .Text }}" referrerpolicy="no-referrer" loading="lazy">
{{- end -}}