add base image location
This commit is contained in:
@@ -2,8 +2,11 @@
|
||||
{{ $alt := .alt }}
|
||||
{{ $imgDict := .imgDict }}
|
||||
|
||||
<img src="{{ $imgDict.default.Permalink }}"
|
||||
class="{{ $class }}" loading="lazy"
|
||||
{{- with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{- end -}}
|
||||
{{- if $imgDict.responsive -}} {{ with partial "renderer/_srcset" $imgDict }} srcset="{{ . }}"{{- end }} {{- end -}}
|
||||
{{- with $alt }} alt="{{ . }}" {{- end }}>
|
||||
{{ $base := default "/images/lazyimg" .imageBasePath }}
|
||||
{{ $src := path.Join $base (strings.TrimPrefix "/" $imgDict.default.RelPermalink) }}
|
||||
|
||||
<img src="{{ $src }}"
|
||||
class="{{ $class }}" loading="lazy"
|
||||
{{ with $imgDict.default }} height="{{ .Height }}" width="{{ .Width }}" {{ end }}
|
||||
{{ if $imgDict.responsive }}{{ with partial "renderer/_srcset" (merge $imgDict (dict "imageBasePath" $base)) }} srcset="{{ . }}"{{ end }}{{ end }}
|
||||
{{ with $alt }} alt="{{ . }}" {{ end }}>
|
||||
|
||||
Reference in New Issue
Block a user