diff --git a/README.md b/README.md index 7eb313ab..3a00b012 100644 --- a/README.md +++ b/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:
-
align
-
Optional. String. Horizontal alignment of the figure and caption. Must be start, center, or end. Default is center.
caption
Optional. Position 0. String. Markdown. Descriptive text below the content.
float
Optional. String. Float to one side of its container. Must be start or end.
height
Optional. String. CSS value. Total height.
-
justify
-
Optional. String. Vertical alignment of the figure and caption. Must be start, center, or end. Default is center.
+
horizontal
+
Optional. String. Horizontal alignment. Must be start, center, or end. Default is center.
maxheight
Optional. String. CSS value. Maximum total height.
maxwidth
@@ -455,6 +453,8 @@ Parameters:
Optional. Integer or string. Figure number. Displayed with the caption.
numbered
Optional. Boolean. Number the figure automatically. Displayed with the caption.
+
vertical
+
Optional. String. Vertical alignment. Must be start, center, or end. Default is center.
width
Optional. String. CSS value. Total width.
diff --git a/exampleSite/content/blog/figure-shortcode.md b/exampleSite/content/blog/figure-shortcode.md index 55191a46..8e16ffa9 100644 --- a/exampleSite/content/blog/figure-shortcode.md +++ b/exampleSite/content/blog/figure-shortcode.md @@ -41,121 +41,53 @@ Don't believe everything you read on the Internet. Code: ```go-text-template -{{}} -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" >}} -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 -{{}} -Michael was having brunch -{{}} - -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 -{{}} -Don't believe everything you read on the Internet. -{{}} - -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 -{{}} -
-Hickory dickory dock. +{{}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{}} -{{}} -
-Hickory dickory dock. +{{}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{}} -{{}} -
-Hickory dickory dock. +{{}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{}} ``` Result: -{{< paige/figure caption="Hickory Dickory Dock" align="start" >}} -
-Hickory dickory dock. +{{< paige/figure caption="Hickory Dickory Dock" horizontal="start" >}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{< /paige/figure >}} -{{< paige/figure caption="Hickory Dickory Dock" align="center" >}} -
-Hickory dickory dock. +{{< paige/figure caption="Hickory Dickory Dock" horizontal="center" >}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{< /paige/figure >}} -{{< paige/figure caption="Hickory Dickory Dock" align="end" >}} -
-Hickory dickory dock. +{{< paige/figure caption="Hickory Dickory Dock" horizontal="end" >}} +
Hickory dickory dock. The mouse ran up the clock. The clock struck one, The mouse ran down, -Hickory dickory dock. -
+Hickory dickory dock.
{{< /paige/figure >}} diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html index 81776b29..bceb4c3d 100644 --- a/layouts/partials/paige/figure.html +++ b/layouts/partials/paige/figure.html @@ -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 }} -
+
{{ if and (not $float) $style }} -
+
{{ end }} {{ if $table }}
{{ end }} -
{{ $content }}
+
{{ $content }}
{{ if $showcaption }} -
{{ $caption }}
+
{{ $caption }}
{{ end }} {{ if $table }}
diff --git a/layouts/partials/paige/image-figure.html b/layouts/partials/paige/image-figure.html index b095c3ef..c5ea1b2b 100644 --- a/layouts/partials/paige/image-figure.html +++ b/layouts/partials/paige/image-figure.html @@ -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 ) }} diff --git a/layouts/shortcodes/paige/code.html b/layouts/shortcodes/paige/code.html index 43801ad1..9bec848b 100644 --- a/layouts/shortcodes/paige/code.html +++ b/layouts/shortcodes/paige/code.html @@ -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 ) }} diff --git a/layouts/shortcodes/paige/figure.html b/layouts/shortcodes/paige/figure.html index 60e78712..5a915c8b 100644 --- a/layouts/shortcodes/paige/figure.html +++ b/layouts/shortcodes/paige/figure.html @@ -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 ) }} diff --git a/layouts/shortcodes/paige/image.html b/layouts/shortcodes/paige/image.html index 6ec01b54..5e1ef51a 100644 --- a/layouts/shortcodes/paige/image.html +++ b/layouts/shortcodes/paige/image.html @@ -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 ) }} diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index d1b892a3..28e5db6e 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -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 `
%v
` $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 ) }}