add base image location
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
{{ $alt := .alt }}
|
||||
{{ $noscriptSupport := .noscript }}
|
||||
{{ $imgDict := .imgDict }}
|
||||
{{- if $noscriptSupport -}}
|
||||
<noscript>
|
||||
{{ partial "renderer/native" . }}
|
||||
</noscript>
|
||||
{{- end -}}
|
||||
<img data-src="{{ $imgDict.default.Permalink }}" class="{{ $class }} lazyload"
|
||||
{{- with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{- end -}}
|
||||
{{- if $imgDict.responsive -}}{{ with partial "renderer/_srcset" $imgDict }} data-sizes="auto" data-srcset="{{ . }}"{{- end }} {{- end -}}
|
||||
{{- with $alt }} alt="{{ . }}" {{- end }}>
|
||||
{{ if $noscriptSupport }}<noscript>{{ partial "renderer/native" . }}</noscript>{{ end }}
|
||||
|
||||
{{ $base := default "/images/lazyimg" .imageBasePath }}
|
||||
{{ $dataSrc := path.Join $base (strings.TrimPrefix "/" $imgDict.default.RelPermalink) }}
|
||||
|
||||
<img data-src="{{ $dataSrc }}" class="{{ $class }} lazyload"
|
||||
{{ 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 }}
|
||||
{{ with $alt }} alt="{{ . }}" {{ end }}>
|
||||
|
||||
Reference in New Issue
Block a user