add base image location
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
{{ $imgDict := .imgDict }}
|
||||
{{ $imgDictFallback := .imgDictFallback }}
|
||||
|
||||
{{ $base := default "/images/lazyimg" .imageBasePath }}
|
||||
<picture>
|
||||
<source type="image/webp"
|
||||
{{- with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{- end -}}
|
||||
{{- if $imgDict.responsive -}}{{ with partial "renderer/_srcset" $imgDict }} data-sizes="auto" data-srcset="{{ . }}"{{- end }} {{- end -}}>
|
||||
{{ partial "renderer/simple" (merge . (dict "imgDict" $imgDictFallback)) }}
|
||||
</picture>
|
||||
<source type="image/webp"
|
||||
{{ with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{ end }}
|
||||
{{ if $imgDict.responsive }}{{ with partial "renderer/_srcset" (merge $imgDict (dict "imageBasePath" $base)) }} data-sizes="auto" data-srcset="{{ . }}"{{ end }}{{ end }}>
|
||||
{{ partial "renderer/simple" (merge . (dict "imgDict" $imgDictFallback "imageBasePath" $base)) }}
|
||||
</picture>
|
||||
|
||||
Reference in New Issue
Block a user