Add intrinsic height, width vars
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
{{ $fingerprint := .fingerprint | default true }}
|
||||
{{ $height := .height }}
|
||||
{{ $loading := .loading | default "lazy" }}
|
||||
{{ $maxheight := .maxheight }}
|
||||
{{ $maxwidth := .maxwidth }}
|
||||
{{ $method := .method }}
|
||||
{{ $options := .options }}
|
||||
{{ $page := .page }}
|
||||
@@ -16,6 +18,9 @@
|
||||
{{ $title := .title }}
|
||||
{{ $width := .width }}
|
||||
|
||||
{{ $intrinsicheight := $height }}
|
||||
{{ $intrinsicwidth := $width }}
|
||||
|
||||
{{ if $raw }}
|
||||
{{ $src = relLangURL $src }}
|
||||
{{ else }}
|
||||
@@ -38,10 +43,12 @@
|
||||
{{ errorf "invalid method: %q" $method }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $intrinsicheight = $resource.Height }}
|
||||
{{ $intrinsicwidth = $resource.Width }}
|
||||
{{ if $fingerprint }}
|
||||
{{ $resource = $resource | fingerprint }}
|
||||
{{ end }}
|
||||
{{ $src = $resource.RelPermalink }}
|
||||
{{ 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 }}>
|
||||
<img {{ with $alt }} alt="{{ . }}" {{ end }} {{ with $class }} class="{{ . }}" {{ end }} {{ with $crossorigin }} crossorigin="{{ . }}" {{end }} {{ with $fetchpriority }} fetchpriority="{{ . }}" {{ end }} {{ with $intrinsicheight }} height="{{ . }}" {{ end }} loading="{{ $loading }}" referrerpolicy="{{ $referrerpolicy }}" src="{{ $src }}" {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ with $title }} title="{{ . }}" {{ end }} {{ with $intrinsicwidth }} width="{{ . }}" {{ end }}>
|
||||
|
Reference in New Issue
Block a user