76 lines
2.2 KiB
HTML
76 lines
2.2 KiB
HTML
{{ $caption := .caption | markdownify }}
|
|
{{ $content := .content | markdownify }}
|
|
{{ $float := .float }}
|
|
{{ $height := .height }}
|
|
{{ $maxheight := .maxheight }}
|
|
{{ $maxwidth := .maxwidth }}
|
|
{{ $width := .width }}
|
|
|
|
{{ $style := "" }}
|
|
|
|
{{ if $height }}
|
|
{{ with printf "height: %v" $height }}
|
|
{{ if $style }}
|
|
{{ $style = printf "%v; %v" $style . }}
|
|
{{ else }}
|
|
{{ $style = . }}
|
|
{{ end }}
|
|
{{ 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 }}
|
|
{{ $style = printf "%v; %v" $style . }}
|
|
{{ else }}
|
|
{{ $style = . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ if $width }}
|
|
{{ with printf "width: %v" $width }}
|
|
{{ if $style }}
|
|
{{ $style = printf "%v; %v" $style . }}
|
|
{{ else }}
|
|
{{ $style = . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ $margin := "" }}
|
|
{{ if $float }}
|
|
{{ if eq $float "start" }}
|
|
{{ $margin = "me-4" }}
|
|
{{ else if eq $float "end" }}
|
|
{{ $margin = "ms-4" }}
|
|
{{ else }}
|
|
{{ errorf "invalid float: %q" $float }}
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
<figure class="{{ with $float }} float-{{ . }} {{ $margin }} {{ end }} align-items-center d-flex flex-column justify-content-center paige-figure" {{ if $float }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ end }}>
|
|
<div class="align-items-center d-flex flex-column justify-content-center {{ if and $float $height }} h-100 {{ end }}" {{ if not $float }} {{ with $style }} style="{{ . | safeCSS }}" {{ end }} {{ end }}>
|
|
{{ if $float }}
|
|
<div class="d-table">
|
|
{{ end }}
|
|
<div {{ if $caption }} class="mb-2" {{ end }}>{{ $content }}</div>
|
|
{{ with $caption }}
|
|
<figcaption class="figure-caption text-center" {{ if $float }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ . }}</figcaption>
|
|
{{ end }}
|
|
{{ if $float }}
|
|
</div>
|
|
{{ end }}
|
|
</div>
|
|
</figure>
|