Rename align, justify params to horizontal, vertical

This commit is contained in:
Will Faught
2023-01-22 16:08:57 -08:00
parent 93428e20e3
commit 290cf41423
8 changed files with 63 additions and 127 deletions

View File

@@ -1,15 +1,15 @@
{{ $align := .align | default "center" }}
{{ $caption := .caption | markdownify }}
{{ $compact := .compact }}
{{ $content := .content | markdownify }}
{{ $float := .float }}
{{ $gap := .gap }}
{{ $height := .height }}
{{ $justify := .justify | default "center" }}
{{ $horizontal := .horizontal | default "center" }}
{{ $maxheight := .maxheight }}
{{ $maxwidth := .maxwidth }}
{{ $number := .number }}
{{ $numbered := .numbered }}
{{ $vertical := .vertical | default "center" }}
{{ $width := .width }}
{{ $table := false }}
@@ -87,16 +87,16 @@
{{ end }}
{{ end }}
<figure class="align-items-{{ $align }} d-flex flex-column {{ with $float }} float-{{ . }} {{ end }} justify-content-{{ $justify }} {{ if $compact }} mb-0 {{ end }} {{ if $float }} {{ $sidemargin }} {{ end }} paige-figure {{ if $numbered }} paige-figure-numbered {{ end }}" {{ if and $float $style }} style="{{ $style | safeCSS }}" {{ end }}>
<figure class="align-items-{{ $horizontal }} d-flex flex-column {{ with $float }} float-{{ . }} {{ end }} justify-content-{{ $vertical }} {{ if $compact }} mb-0 {{ end }} {{ if $float }} {{ $sidemargin }} {{ end }} paige-figure {{ if $numbered }} paige-figure-numbered {{ end }}" {{ if and $float $style }} style="{{ $style | safeCSS }}" {{ end }}>
{{ if and (not $float) $style }}
<div class="align-items-{{ $align }} d-flex flex-column {{ if $height }} h-100 {{ end }} justify-content-{{ $justify }}" style="{{ $style | safeCSS }}">
<div class="align-items-{{ $horizontal }} d-flex flex-column {{ if $height }} h-100 {{ end }} justify-content-{{ $vertical }}" style="{{ $style | safeCSS }}">
{{ end }}
{{ if $table }}
<div class="d-table">
{{ end }}
<div class="text-{{ $align }}">{{ $content }}</div>
<div class="text-{{ $horizontal }}">{{ $content }}</div>
{{ if $showcaption }}
<figcaption class="figure-caption {{ with $gap }} mt-{{ . }} {{ end }} text-{{ $align }}" {{ if $table }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ $caption }}</figcaption>
<figcaption class="figure-caption {{ with $gap }} mt-{{ . }} {{ end }} text-{{ $horizontal }}" {{ if $table }} style="caption-side: bottom; display: table-caption" {{ end }}>{{ $caption }}</figcaption>
{{ end }}
{{ if $table }}
</div>

View File

@@ -3,6 +3,7 @@
{{ $compact := .compact }}
{{ $float := .float }}
{{ $height := .height }}
{{ $horizontal := .horizontal }}
{{ $link := .link }}
{{ $maxheight := .maxheight }}
{{ $maxwidth := .maxwidth }}
@@ -16,6 +17,7 @@
{{ $src := .src }}
{{ $table := .table }}
{{ $title := .title }}
{{ $vertical := .vertical }}
{{ $width := .width }}
{{ $content := partial "paige/img.html" (dict
@@ -43,9 +45,11 @@
"content" $content
"float" $float
"height" $height
"horizontal" $horizontal
"maxheight" $maxheight
"maxwidth" $maxwidth
"number" $number
"numbered" $numbered
"vertical" $vertical
"width" $width
) }}

View File

@@ -1,29 +1,29 @@
{{ $align := .Get "align" }}
{{ $caption := .Get "caption" }}
{{ $float := .Get "float" }}
{{ $height := .Get "height" }}
{{ $justify := .Get "justify" }}
{{ $horizontal := .Get "horizontal" }}
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $number := .Get "number" }}
{{ $numbered := .Get "numbered" }}
{{ $options := .Get "options" }}
{{ $vertical := .Get "vertical" }}
{{ $width := .Get "width" }}
{{ $content := highlight (.Inner | replaceRE "^\n" "") $lang $options }}
{{ partial "paige/figure.html" (dict
"align" $align
"caption" $caption
"content" $content
"float" $float
"gap" 2
"height" $height
"justify" $justify
"horizontal" $horizontal
"maxheight" $maxheight
"maxwidth" $maxwidth
"number" $number
"numbered" $numbered
"vertical" $vertical
"width" $width
) }}

View File

@@ -1,26 +1,26 @@
{{ $align := .Get "align" }}
{{ $caption := .Get 0 | default (.Get "caption") }}
{{ $content := .Inner }}
{{ $float := .Get "float" }}
{{ $height := .Get "height" }}
{{ $justify := .Get "justify" }}
{{ $horizontal := .Get "horizontal" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $number := .Get "number" }}
{{ $numbered := .Get "numbered" }}
{{ $vertical := .Get "vertical" }}
{{ $width := .Get "width" }}
{{ partial "paige/figure.html" (dict
"align" $align
"caption" $caption
"content" $content
"float" $float
"gap" 2
"height" $height
"justify" $justify
"horizontal" $horizontal
"maxheight" $maxheight
"maxwidth" $maxwidth
"number" $number
"numbered" $numbered
"vertical" $vertical
"width" $width
) }}

View File

@@ -1,9 +1,8 @@
{{ $align := .Get "align" }}
{{ $alt := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $float := .Get "float" }}
{{ $height := .Get "height" }}
{{ $justify := .Get "justify" }}
{{ $horizontal := .Get "horizontal" }}
{{ $link := .Get "link" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
@@ -14,16 +13,16 @@
{{ $raw := .Get "raw" }}
{{ $src := .Get 0 | default (.Get "src") }}
{{ $title := .Get "title" }}
{{ $vertical := .Get "vertical" }}
{{ $width := .Get "width" }}
{{ partial "paige/image-figure.html" (dict
"align" $align
"alt" $alt
"caption" $caption
"float" $float
"gap" 2
"height" $height
"justify" $justify
"horizontal" $horizontal
"link" $link
"maxheight" $maxheight
"maxwidth" $maxwidth
@@ -34,5 +33,6 @@
"raw" $raw
"src" $src
"title" $title
"vertical" $vertical
"width" $width
) }}

View File

@@ -1,27 +1,27 @@
{{ $align := .Get "align" }}
{{ $caption := .Get 0 | default (.Get "caption") }}
{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" }}
{{ $float := .Get "float" }}
{{ $height := .Get "height" }}
{{ $justify := .Get "justify" }}
{{ $horizontal := .Get "horizontal" }}
{{ $maxheight := .Get "maxheight" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $number := .Get "number" }}
{{ $numbered := .Get "numbered" }}
{{ $vertical := .Get "vertical" }}
{{ $width := .Get "width" }}
{{ $content = printf `<blockquote class="blockquote mb-0">%v</blockquote>` $content }}
{{ partial "paige/figure.html" (dict
"align" $align
"caption" $caption
"content" $content
"float" $float
"height" $height
"justify" $justify
"horizontal" $horizontal
"maxheight" $maxheight
"maxwidth" $maxwidth
"number" $number
"numbered" $numbered
"vertical" $vertical
"width" $width
) }}