Add crossorigin param to img.html

This commit is contained in:
Will Faught
2023-01-07 08:30:33 -08:00
parent f3f47f5734
commit e0776fbffc

View File

@@ -1,5 +1,6 @@
{{ $alt := .alt }}
{{ $class := .class }}
{{ $crossorigin := .crossorigin | default "anonymous" }}
{{ $fetchpriority := .fetchpriority }}
{{ $height := .height }}
{{ $loading := .loading | default "lazy" }}
@@ -39,4 +40,4 @@
{{ $src = ($resource | fingerprint).RelPermalink }}
{{ end }}
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} {{ with $fetchpriority }} fetchpriority="{{ . }}" {{ end }} {{ with $height }} height="{{ . }}" {{ end }} loading="{{ $loading }}" referrerpolicy="{{ $referrerpolicy }}" src="{{ $src }}" {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}>
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} {{ with $crossorigin }} crossorigin="{{ . }}" {{ end }} {{ with $fetchpriority }} fetchpriority="{{ . }}" {{ end }} {{ with $height }} height="{{ . }}" {{ end }} loading="{{ $loading }}" referrerpolicy="{{ $referrerpolicy }}" src="{{ $src }}" {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $width }} width="{{ . }}" {{ end }}>