🔀 Merge pull request #730 from stereobooster/fix-bug-in-picture

fix bug in picture with params
This commit is contained in:
James Panther
2024-01-21 14:31:01 +11:00
committed by GitHub
5 changed files with 13 additions and 6 deletions
+3 -1
View File
@@ -19,7 +19,9 @@
{{ with $href }}<a href="{{ . }}">{{ end }}
{{- with $img -}}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class) }}
{{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" $lazy "webp" $webp) }}
{{- else -}}
<img src="{{ $url.String }}" alt="{{ $altText }}" class="{{ $class }}"/>
{{- end -}}