Add justify param
This commit is contained in:
15
README.md
15
README.md
@@ -511,7 +511,7 @@ title: Search
|
|||||||
The `paige/figure` shortcode provides a figure with centered content.
|
The `paige/figure` shortcode provides a figure with centered content.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{< paige/figure align="center" caption="My caption" float="left" >}}
|
{{< paige/figure align="center" caption="My caption" float="left" justify="center" >}}
|
||||||
My content
|
My content
|
||||||
{{< /paige/figure >}}
|
{{< /paige/figure >}}
|
||||||
```
|
```
|
||||||
@@ -527,6 +527,8 @@ Parameters:
|
|||||||
<dd>Optional. Position 0. String. Markdown. Descriptive text that appears centered below the content.</dd>
|
<dd>Optional. Position 0. String. Markdown. Descriptive text that appears centered below the content.</dd>
|
||||||
<dt><code>float</code></dt>
|
<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>
|
<dd>Optional. String. Float to one side of its container. Must be <code>start</code> or <code>end</code>.</dd>
|
||||||
|
<dt><code>justify</code></dt>
|
||||||
|
<dd>Optional. String. Vertical spacing of the figure and caption. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
### Quote
|
### Quote
|
||||||
@@ -534,7 +536,7 @@ Parameters:
|
|||||||
The `paige/quote` shortcode provides a figure with a centered quotation.
|
The `paige/quote` shortcode provides a figure with a centered quotation.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{< paige/quote align="center" caption="My caption" cite="My citation" float="left" >}}
|
{{< paige/quote align="center" caption="My caption" cite="My citation" float="left" justify="center" >}}
|
||||||
My content
|
My content
|
||||||
{{< /paige/quote >}}
|
{{< /paige/quote >}}
|
||||||
```
|
```
|
||||||
@@ -552,6 +554,8 @@ Parameters:
|
|||||||
<dd>Optional. Position 0. String. Markdown. Citation text that appears centered below the quotation. Must not be used with <code>caption</code>.</dd>
|
<dd>Optional. Position 0. String. Markdown. Citation text that appears centered below the quotation. Must not be used with <code>caption</code>.</dd>
|
||||||
<dt><code>float</code></dt>
|
<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>
|
<dd>Optional. String. Float to one side of its container. Must be <code>start</code> or <code>end</code>.</dd>
|
||||||
|
<dt><code>justify</code></dt>
|
||||||
|
<dd>Optional. String. Vertical spacing of the figure and caption. Must be <code>start</code>, <code>center</code>, or <code>end</code>. Default is <code>center</code>.</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
### Code
|
### Code
|
||||||
@@ -559,7 +563,7 @@ Parameters:
|
|||||||
The `paige/code` shortcode provides a figure with centered code.
|
The `paige/code` shortcode provides a figure with centered code.
|
||||||
|
|
||||||
```
|
```
|
||||||
{{< paige/code align="center" caption="My caption" float="left" lang="html" options="linenos=true" >}}
|
{{< paige/code align="center" caption="My caption" float="left" justify="center" lang="html" options="linenos=true" >}}
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<body>
|
<body>
|
||||||
@@ -580,6 +584,8 @@ Parameters:
|
|||||||
<dd>Optional. String. Markdown. Descriptive text that appears centered below the code.</dd>
|
<dd>Optional. String. Markdown. Descriptive text that appears centered below the code.</dd>
|
||||||
<dt><code>float</code></dt>
|
<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>
|
<dd>Optional. String. Float to one side of its container. Must be <code>start</code> or <code>end</code>.</dd>
|
||||||
|
<dt><code>justify</code></dt>
|
||||||
|
<dd>Optional. String. Vertical spacing 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>lang</code></dt>
|
<dt><code>lang</code></dt>
|
||||||
<dd>Optional. Position 0. String. Chroma language code. Defaults to <code>plaintext</code>. See <a href="https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages">available codes</a>.</dd>
|
<dd>Optional. Position 0. String. Chroma language code. Defaults to <code>plaintext</code>. See <a href="https://gohugo.io/content-management/syntax-highlighting/#list-of-chroma-highlighting-languages">available codes</a>.</dd>
|
||||||
<dt><code>options</code></dt>
|
<dt><code>options</code></dt>
|
||||||
@@ -597,6 +603,7 @@ The `paige/image` shortcode provides a figure with a centered image.
|
|||||||
caption="My caption"
|
caption="My caption"
|
||||||
float="left"
|
float="left"
|
||||||
height="10rem"
|
height="10rem"
|
||||||
|
justify="center"
|
||||||
link="https://github.com/willfaught/paige"
|
link="https://github.com/willfaught/paige"
|
||||||
maxheight="10rem"
|
maxheight="10rem"
|
||||||
maxwidth="10rem"
|
maxwidth="10rem"
|
||||||
@@ -621,6 +628,8 @@ Parameters:
|
|||||||
<dd>Optional. String. Float to one side of its container. Must be <code>start</code> or <code>end</code>.</dd>
|
<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>
|
<dt><code>height</code></dt>
|
||||||
<dd>Optional. String. Image height.</dd>
|
<dd>Optional. String. Image height.</dd>
|
||||||
|
<dt><code>justify</code></dt>
|
||||||
|
<dd>Optional. String. Vertical spacing 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>link</code></dt>
|
<dt><code>link</code></dt>
|
||||||
<dd>Optional. String. URL. Image link.</dd>
|
<dd>Optional. String. URL. Image link.</dd>
|
||||||
<dt><code>maxheight</code></dt>
|
<dt><code>maxheight</code></dt>
|
||||||
|
@@ -57,7 +57,7 @@ Michael was having brunch with Sally Sitwell at a restaurant called Skip Church'
|
|||||||
Code:
|
Code:
|
||||||
|
|
||||||
```go-text-template
|
```go-text-template
|
||||||
{{</* paige/figure caption="Michael was having brunch with Sally Sitwell" float="end" */>}}
|
{{</* 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
|
Michael was having brunch
|
||||||
{{</* /paige/figure */>}}
|
{{</* /paige/figure */>}}
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ Michael was having brunch with Sally Sitwell at a restaurant called Skip Church'
|
|||||||
|
|
||||||
Result:
|
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" >}}
|
{{< 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
|
Michael was having brunch with Sally Sitwell
|
||||||
{{< /paige/figure >}}
|
{{< /paige/figure >}}
|
||||||
|
|
||||||
|
@@ -5,6 +5,7 @@
|
|||||||
{{ $float := .float }}
|
{{ $float := .float }}
|
||||||
{{ $gap := .gap }}
|
{{ $gap := .gap }}
|
||||||
{{ $height := .height }}
|
{{ $height := .height }}
|
||||||
|
{{ $justify := .justify | default "center" }}
|
||||||
{{ $maxheight := .maxheight }}
|
{{ $maxheight := .maxheight }}
|
||||||
{{ $maxwidth := .maxwidth }}
|
{{ $maxwidth := .maxwidth }}
|
||||||
{{ $width := .width }}
|
{{ $width := .width }}
|
||||||
@@ -69,9 +70,9 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<figure class="align-items-{{ $align }} d-flex flex-column {{ with $float }} float-{{ . }} {{ end }} justify-content-center {{ if $compact }} mb-0 {{ end }} {{ if $float }} {{ $sidemargin }} {{ end }} paige-figure" {{ if and $float $style }} style="{{ $style | safeCSS }}" {{ 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 and $float $style }} style="{{ $style | safeCSS }}" {{ end }}>
|
||||||
{{ if and (not $float) $style }}
|
{{ if and (not $float) $style }}
|
||||||
<div class="align-items-{{ $align }} d-flex flex-column {{ if $height }} h-100 {{ end }} justify-content-center" style="{{ $style | safeCSS }}">
|
<div class="align-items-{{ $align }} d-flex flex-column {{ if $height }} h-100 {{ end }} justify-content-{{ $justify }}" style="{{ $style | safeCSS }}">
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ if $table }}
|
{{ if $table }}
|
||||||
<div class="d-table">
|
<div class="d-table">
|
||||||
|
@@ -2,6 +2,7 @@
|
|||||||
{{ $caption := .Get "caption" }}
|
{{ $caption := .Get "caption" }}
|
||||||
{{ $float := .Get "float" }}
|
{{ $float := .Get "float" }}
|
||||||
{{ $height := .Get "height" }}
|
{{ $height := .Get "height" }}
|
||||||
|
{{ $justify := .Get "justify" }}
|
||||||
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
|
{{ $lang := .Get 0 | default (.Get "lang") | default "plaintext" }}
|
||||||
{{ $maxheight := .Get "maxheight" }}
|
{{ $maxheight := .Get "maxheight" }}
|
||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
@@ -17,6 +18,7 @@
|
|||||||
"float" $float
|
"float" $float
|
||||||
"gap" 2
|
"gap" 2
|
||||||
"height" $height
|
"height" $height
|
||||||
|
"justify" $justify
|
||||||
"maxheight" $maxheight
|
"maxheight" $maxheight
|
||||||
"maxwidth" $maxwidth
|
"maxwidth" $maxwidth
|
||||||
"width" $width
|
"width" $width
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
{{ $content := .Inner | markdownify }}
|
{{ $content := .Inner | markdownify }}
|
||||||
{{ $float := .Get "float" }}
|
{{ $float := .Get "float" }}
|
||||||
{{ $height := .Get "height" }}
|
{{ $height := .Get "height" }}
|
||||||
|
{{ $justify := .Get "justify" }}
|
||||||
{{ $maxheight := .Get "maxheight" }}
|
{{ $maxheight := .Get "maxheight" }}
|
||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
{{ $width := .Get "width" }}
|
{{ $width := .Get "width" }}
|
||||||
@@ -14,6 +15,7 @@
|
|||||||
"float" $float
|
"float" $float
|
||||||
"gap" 2
|
"gap" 2
|
||||||
"height" $height
|
"height" $height
|
||||||
|
"justify" $justify
|
||||||
"maxheight" $maxheight
|
"maxheight" $maxheight
|
||||||
"maxwidth" $maxwidth
|
"maxwidth" $maxwidth
|
||||||
"width" $width
|
"width" $width
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
{{ $caption := .Get "caption" }}
|
{{ $caption := .Get "caption" }}
|
||||||
{{ $float := .Get "float" }}
|
{{ $float := .Get "float" }}
|
||||||
{{ $height := .Get "height" }}
|
{{ $height := .Get "height" }}
|
||||||
|
{{ $justify := .Get "justify" }}
|
||||||
{{ $link := .Get "link" }}
|
{{ $link := .Get "link" }}
|
||||||
{{ $maxheight := .Get "maxheight" }}
|
{{ $maxheight := .Get "maxheight" }}
|
||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
@@ -20,6 +21,7 @@
|
|||||||
"float" $float
|
"float" $float
|
||||||
"gap" 2
|
"gap" 2
|
||||||
"height" $height
|
"height" $height
|
||||||
|
"justify" $justify
|
||||||
"link" $link
|
"link" $link
|
||||||
"maxheight" $maxheight
|
"maxheight" $maxheight
|
||||||
"maxwidth" $maxwidth
|
"maxwidth" $maxwidth
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
{{ $content := .Inner | markdownify }}
|
{{ $content := .Inner | markdownify }}
|
||||||
{{ $float := .Get "float" }}
|
{{ $float := .Get "float" }}
|
||||||
{{ $height := .Get "height" }}
|
{{ $height := .Get "height" }}
|
||||||
|
{{ $justify := .Get "justify" }}
|
||||||
{{ $maxheight := .Get "maxheight" }}
|
{{ $maxheight := .Get "maxheight" }}
|
||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
{{ $width := .Get "width" }}
|
{{ $width := .Get "width" }}
|
||||||
@@ -15,6 +16,7 @@
|
|||||||
"content" $content
|
"content" $content
|
||||||
"float" $float
|
"float" $float
|
||||||
"height" $height
|
"height" $height
|
||||||
|
"justify" $justify
|
||||||
"maxheight" $maxheight
|
"maxheight" $maxheight
|
||||||
"maxwidth" $maxwidth
|
"maxwidth" $maxwidth
|
||||||
"width" $width
|
"width" $width
|
||||||
|
Reference in New Issue
Block a user