Compare commits

...

2 Commits

Author SHA1 Message Date
stereobooster 8e846cf2b7
Merge f2af0198fa into 99ec58e91e 2023-12-27 16:33:06 -06:00
stereobooster f2af0198fa fix bug in picture with params 2023-11-29 14:51:44 +01:00
5 changed files with 13 additions and 6 deletions

View File

@ -20,7 +20,9 @@
<figure>
{{- with $img -}}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "x2" $x2) }}
{{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "x2" $x2 "lazy" $lazy "webp" $webp) }}
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}" />
{{- end -}}

View File

@ -18,7 +18,8 @@
<div class="prose">
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
{{ $class := "mb-6 -mt-4 rounded-md" }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" false) }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" . "alt" $altText "class" $class "lazy" false "webp" $webp) }}
{{ with $.Params.coverCaption }}
<figcaption class="-mt-3 mb-6 text-center">{{ . | markdownify }}</figcaption>
{{ end }}

View File

@ -1,8 +1,8 @@
{{ $img := .img }}
{{ $alt := .alt }}
{{ $class := .class }}
{{ $lazy := .lazy | default $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ $webp := .webp | default $.Page.Site.Params.enableImageWebp | default true }}
{{ $lazy := .lazy }}
{{ $webp := .webp }}
{{ $lqip := .lqip | default false }}
{{ $x2 := .x2 | default false }}

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 -}}

View File

@ -13,7 +13,9 @@
{{ $altText = (.Get "caption") | markdownify | plainify }}
{{ end }}
{{ partial "picture.html" (dict "img" $image "alt" $altText "x2" true) }}
{{ $lazy := $.Page.Site.Params.enableImageLazyLoading | default true }}
{{ $webp := $.Page.Site.Params.enableImageWebp | default true }}
{{ partial "picture.html" (dict "img" $image "alt" $altText "x2" true "lazy" $lazy "webp" $webp) }}
{{- if .Get "href" }}</a>{{ end -}}
{{- if .Get "caption" -}}