Rename align, justify params to horizontal, vertical
This commit is contained in:
12
README.md
12
README.md
@@ -417,15 +417,15 @@ The `paige/figure` shortcode provides a figure with content.
|
||||
|
||||
```
|
||||
{{< paige/figure
|
||||
align="center"
|
||||
caption="My caption"
|
||||
float="left"
|
||||
height="10rem"
|
||||
justify="center"
|
||||
horizontal="center"
|
||||
maxheight="10rem"
|
||||
maxwidth="10rem"
|
||||
number=0
|
||||
numbered=false
|
||||
vertical="center"
|
||||
width="10rem"
|
||||
>}}
|
||||
My content
|
||||
@@ -437,16 +437,14 @@ Inner content: Required. String. Markdown. The content.
|
||||
Parameters:
|
||||
|
||||
<dl>
|
||||
<dt><code>align</code></dt>
|
||||
<dd>Optional. String. Horizontal alignment of the figure and caption. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||
<dt><code>caption</code></dt>
|
||||
<dd>Optional. Position 0. String. Markdown. Descriptive text below the content.</dd>
|
||||
<dt><code>float</code></dt>
|
||||
<dd>Optional. String. Float to one side of its container. Must be <code>start</code> or <code>end</code>.</dd>
|
||||
<dt><code>height</code></dt>
|
||||
<dd>Optional. String. CSS value. Total height.</dd>
|
||||
<dt><code>justify</code></dt>
|
||||
<dd>Optional. String. Vertical alignment of the figure and caption. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||
<dt><code>horizontal</code></dt>
|
||||
<dd>Optional. String. Horizontal alignment. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||
<dt><code>maxheight</code></dt>
|
||||
<dd>Optional. String. CSS value. Maximum total height.</dd>
|
||||
<dt><code>maxwidth</code></dt>
|
||||
@@ -455,6 +453,8 @@ Parameters:
|
||||
<dd>Optional. Integer or string. Figure number. Displayed with the caption.</dd>
|
||||
<dt><code>numbered</code></dt>
|
||||
<dd>Optional. Boolean. Number the figure automatically. Displayed with the caption.</dd>
|
||||
<dt><code>vertical</code></dt>
|
||||
<dd>Optional. String. Vertical alignment. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||
<dt><code>width</code></dt>
|
||||
<dd>Optional. String. CSS value. Total width.</dd>
|
||||
</dl>
|
||||
|
@@ -41,121 +41,53 @@ Don't believe everything you read on the Internet.
|
||||
Code:
|
||||
|
||||
```go-text-template
|
||||
{{</* paige/figure caption="Abraham Lincoln" */>}}
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" horizontal="start" */>}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.</div>
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" horizontal="center" */>}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.</div>
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" horizontal="end" */>}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.</div>
|
||||
{{</* /paige/figure */>}}
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
{{< paige/figure caption="Abraham Lincoln" >}}
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
{{< /paige/figure >}}
|
||||
|
||||
---
|
||||
|
||||
Code:
|
||||
|
||||
```go-text-template
|
||||
{{</* paige/figure caption="Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro." width="20%" height="15rem" float="end" justify="center" */>}}
|
||||
Michael was having brunch
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
{{< paige/figure caption="Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro." width="20%" height="15rem" float="end" justify="center" >}}
|
||||
Michael was having brunch with Sally Sitwell
|
||||
{{< /paige/figure >}}
|
||||
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
|
||||
---
|
||||
|
||||
Code:
|
||||
|
||||
```go-text-template
|
||||
{{</* paige/figure caption="Abraham Lincoln" float="start" */>}}
|
||||
Don't believe everything you read on the Internet.
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
{{< paige/figure caption="Abraham Lincoln" float="start" >}}
|
||||
Don't believe everything you read on the Internet.
|
||||
{{< /paige/figure >}}
|
||||
|
||||
Michael was having brunch with Sally Sitwell at a restaurant called Skip Church's Bistro. In addition to brunch, the restaurant was known for an item on the menu called the "Skip's Scramble", an omelet that contained everything on the menu. Do not order the Skip's Scramble. You might enjoy this. Oh. Em. Gee. That's amazing. It feels good to be back in a queen! I need a tea to give my dingle less tingle. Teamocil. Heyyyyyy Uncle Father Oscar.
|
||||
|
||||
---
|
||||
|
||||
Code:
|
||||
|
||||
```go-text-template
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" align="start" */>}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
{{< paige/figure caption="Hickory Dickory Dock" horizontal="start" >}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" align="center" */>}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
{{</* /paige/figure */>}}
|
||||
|
||||
{{</* paige/figure caption="Hickory Dickory Dock" align="end" */>}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
{{</* /paige/figure */>}}
|
||||
```
|
||||
|
||||
Result:
|
||||
|
||||
{{< paige/figure caption="Hickory Dickory Dock" align="start" >}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
Hickory dickory dock.</div>
|
||||
{{< /paige/figure >}}
|
||||
|
||||
{{< paige/figure caption="Hickory Dickory Dock" align="center" >}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
{{< paige/figure caption="Hickory Dickory Dock" horizontal="center" >}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
Hickory dickory dock.</div>
|
||||
{{< /paige/figure >}}
|
||||
|
||||
{{< paige/figure caption="Hickory Dickory Dock" align="end" >}}
|
||||
<div style="white-space: pre">
|
||||
Hickory dickory dock.
|
||||
{{< paige/figure caption="Hickory Dickory Dock" horizontal="end" >}}
|
||||
<div style="white-space: pre">Hickory dickory dock.
|
||||
The mouse ran up the clock.
|
||||
The clock struck one,
|
||||
The mouse ran down,
|
||||
Hickory dickory dock.
|
||||
</div>
|
||||
Hickory dickory dock.</div>
|
||||
{{< /paige/figure >}}
|
||||
|
@@ -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>
|
||||
|
@@ -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
|
||||
) }}
|
||||
|
@@ -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
|
||||
) }}
|
||||
|
@@ -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
|
||||
) }}
|
||||
|
@@ -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
|
||||
) }}
|
||||
|
@@ -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
|
||||
) }}
|
||||
|
Reference in New Issue
Block a user