mirror of https://github.com/jpanther/congo.git
fix bug in picture with params
parent
dbf421848f
commit
f2af0198fa
|
@ -20,7 +20,9 @@
|
||||||
|
|
||||||
<figure>
|
<figure>
|
||||||
{{- with $img -}}
|
{{- 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 -}}
|
{{- else -}}
|
||||||
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
<img src="{{ .Destination | safeURL }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
<div class="prose">
|
<div class="prose">
|
||||||
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
|
{{ $altText := $.Params.featureAlt | default $.Params.coverAlt | default "" }}
|
||||||
{{ $class := "mb-6 -mt-4 rounded-md" }}
|
{{ $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 }}
|
{{ with $.Params.coverCaption }}
|
||||||
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
|
<figcaption class="mb-6 -mt-3 text-center">{{ . | markdownify }}</figcaption>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
{{ $img := .img }}
|
{{ $img := .img }}
|
||||||
{{ $alt := .alt }}
|
{{ $alt := .alt }}
|
||||||
{{ $class := .class }}
|
{{ $class := .class }}
|
||||||
{{ $lazy := .lazy | default $.Page.Site.Params.enableImageLazyLoading | default true }}
|
{{ $lazy := .lazy }}
|
||||||
{{ $webp := .webp | default $.Page.Site.Params.enableImageWebp | default true }}
|
{{ $webp := .webp }}
|
||||||
{{ $lqip := .lqip | default false }}
|
{{ $lqip := .lqip | default false }}
|
||||||
{{ $x2 := .x2 | default false }}
|
{{ $x2 := .x2 | default false }}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,9 @@
|
||||||
{{ with $href }}<a href="{{ . }}">{{ end }}
|
{{ with $href }}<a href="{{ . }}">{{ end }}
|
||||||
|
|
||||||
{{- with $img -}}
|
{{- 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 -}}
|
{{- else -}}
|
||||||
<img src="{{ $url.String }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
<img src="{{ $url.String }}" alt="{{ $altText }}" class="{{ $class }}"/>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
|
@ -12,7 +12,9 @@
|
||||||
{{ $altText = (.Get "caption") | markdownify | plainify }}
|
{{ $altText = (.Get "caption") | markdownify | plainify }}
|
||||||
{{ end }}
|
{{ 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 "href" }}</a>{{ end -}}
|
||||||
{{- if .Get "caption" -}}
|
{{- if .Get "caption" -}}
|
||||||
|
|
Loading…
Reference in New Issue