Add remote param to img.html
This commit is contained in:
@@ -7,19 +7,22 @@
|
||||
{{ $options := .options }}
|
||||
{{ $page := .page }}
|
||||
{{ $referrerpolicy := .referrerpolicy | default "no-referrer" }}
|
||||
{{ $remote := .remote }}
|
||||
{{ $resource := .resource }}
|
||||
{{ $src := .src }}
|
||||
{{ $style := .style }}
|
||||
{{ $title := .title }}
|
||||
{{ $width := .width }}
|
||||
|
||||
{{ if $remote }}
|
||||
{{ $src = relLangURL $src }}
|
||||
{{ else }}
|
||||
{{ if not $resource }}
|
||||
{{ $resource = partial "paige/func-resource.html" (dict
|
||||
"page" $page
|
||||
"url" $src
|
||||
) }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and $method $options }}
|
||||
{{ if eq $method "crop" }}
|
||||
{{ $resource = $resource.Crop $options }}
|
||||
@@ -33,7 +36,7 @@
|
||||
{{ errorf "invalid method: %q" $method }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $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 }}>
|
||||
|
Reference in New Issue
Block a user