Add gallery maxheight param
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
{{ $fingerprint := $params.fingerprint | default true }}
|
||||
{{ $height := $params.height }}
|
||||
{{ $loading := $params.loading | default "lazy" }}
|
||||
{{ $maxheight := $params.maxheight }}
|
||||
{{ $maxwidth := $params.maxwidth }}
|
||||
{{ $method := $params.method }}
|
||||
{{ $options := $params.options }}
|
||||
@@ -56,11 +57,11 @@
|
||||
{{ $src = $resource.RelPermalink }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and $height (not (or $maxwidth $width)) }}
|
||||
{{ if and (or $height $maxheight) (not (or $maxwidth $width)) }}
|
||||
{{ $width = "auto" }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and (or $maxwidth $width) (not $height) }}
|
||||
{{ if and (or $maxwidth $width) (not (or $height $maxheight)) }}
|
||||
{{ $height = "auto" }}
|
||||
{{ end }}
|
||||
|
||||
@@ -74,6 +75,16 @@
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $maxheight }}
|
||||
{{ with printf "max-height: %v" $maxheight }}
|
||||
{{ if $style }}
|
||||
{{ $style = printf "%v; %v" $style . }}
|
||||
{{ else }}
|
||||
{{ $style = . }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if $maxwidth }}
|
||||
{{ with printf "max-width: %v" $maxwidth }}
|
||||
{{ if $style }}
|
||||
|
@@ -2,6 +2,7 @@
|
||||
{{ $height := .Get "height" }}
|
||||
{{ $images := .Get 0 | default (.Get "images") }}
|
||||
{{ $justify := .Get "justify" | default "center" }}
|
||||
{{ $maxheight := .Get "maxheight" }}
|
||||
{{ $maxwidth := .Get "maxwidth" }}
|
||||
{{ $method := .Get "method" | default "resize" }}
|
||||
{{ $options := .Get "options" | default "550x webp picture Lanczos" }}
|
||||
@@ -39,6 +40,7 @@
|
||||
{{ partial "paige/a.html" (dict
|
||||
"content" (partial "paige/img.html" (dict
|
||||
"height" $height
|
||||
"maxheight" $maxheight
|
||||
"maxwidth" $maxwidth
|
||||
"method" $method
|
||||
"options" $options
|
||||
@@ -61,6 +63,7 @@
|
||||
{{ partial "paige/a.html" (dict
|
||||
"content" (partial "paige/img.html" (dict
|
||||
"height" $height
|
||||
"maxheight" $maxheight
|
||||
"maxwidth" $maxwidth
|
||||
"method" $method
|
||||
"options" $options
|
||||
|
Reference in New Issue
Block a user