diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html index c09b3a4f..d4047f3c 100644 --- a/layouts/partials/paige/figure.html +++ b/layouts/partials/paige/figure.html @@ -14,34 +14,35 @@ {{ $vertical := $params.vertical | default "center" }} {{ $width := $params.width }} -{{ $heightish := or $maxheight $height }} +{{ $heights := slice }} {{ $showcaption := $caption }} {{ $sidemargin := "" }} -{{ $style := slice }} {{ $table := false }} -{{ $widthish := or $maxwidth $width }} +{{ $widths := slice }} {{ if and $caption (or $compact $float) }} {{ $table = true }} {{ end }} {{ if $height }} - {{ $style = $style | append (printf "height: %v" $height) }} + {{ $heights = $heights | append (printf "height: %v" $height) }} {{ end }} {{ if $maxheight }} - {{ $style = $style | append (printf "max-height: %v" $maxheight) }} + {{ $heights = $heights | append (printf "max-height: %v" $maxheight) }} {{ end }} +{{ $heights = delimit ($heights | sort) "; " }} + {{ if $maxwidth }} - {{ $style = $style | append (printf "max-width: %v" $maxwidth) }} + {{ $widths = $widths | append (printf "max-width: %v" $maxwidth) }} {{ end }} {{ if $width }} - {{ $style = $style | append (printf "width: %v" $width) }} + {{ $widths = $widths | append (printf "width: %v" $width) }} {{ end }} -{{ $style = delimit ($style | sort) "; " }} +{{ $widths = delimit ($widths | sort) "; " }} {{ if $float }} {{ if eq $float "start" }} @@ -66,26 +67,12 @@ {{ end }} {{ end }} -
- {{ if or $heightish $widthish (and (not $float) $style) }} -
- {{ end }} - - {{ if $table }} -
- {{ end }} - -
{{ $content }}
+
+
+
{{ $content }}
- {{ if $showcaption }} -
{{ $caption }}
- {{ end }} - - {{ if $table }} -
- {{ end }} - - {{ if or $heightish $widthish (and (not $float) $style) }} -
- {{ end }} -
+ {{ if $showcaption }} +
{{ $caption }}
+ {{ end }} + +