From ab91a710e1568e58da6c6f49b22a823bac818d89 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 15 Jan 2023 22:10:55 -0800 Subject: [PATCH] Align figure content --- exampleSite/content/blog/figure-shortcode.md | 44 +++++++++++++++++++- layouts/partials/paige/figure.html | 2 +- layouts/shortcodes/paige/quote.html | 2 +- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/exampleSite/content/blog/figure-shortcode.md b/exampleSite/content/blog/figure-shortcode.md index fe112551..57d20f45 100644 --- a/exampleSite/content/blog/figure-shortcode.md +++ b/exampleSite/content/blog/figure-shortcode.md @@ -97,7 +97,27 @@ Michael was having brunch with Sally Sitwell at a restaurant called Skip Church' Code: ```go-text-template -{{}} +{{}} +
+Hickory dickory dock. +The mouse ran up the clock. +The clock struck one, +The mouse ran down, +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. The mouse ran up the clock. @@ -110,7 +130,27 @@ Hickory dickory dock. Result: -{{< paige/figure caption="Hickory Dickory Dock" >}} +{{< paige/figure caption="Hickory Dickory Dock" align="start" >}} +
+Hickory dickory dock. +The mouse ran up the clock. +The clock struck one, +The mouse ran down, +Hickory dickory dock. +
+{{< /paige/figure >}} + +{{< paige/figure caption="Hickory Dickory Dock" align="center" >}} +
+Hickory dickory dock. +The mouse ran up the clock. +The clock struck one, +The mouse ran down, +Hickory dickory dock. +
+{{< /paige/figure >}} + +{{< paige/figure caption="Hickory Dickory Dock" align="end" >}}
Hickory dickory dock. The mouse ran up the clock. diff --git a/layouts/partials/paige/figure.html b/layouts/partials/paige/figure.html index be5e1db8..7a236d1a 100644 --- a/layouts/partials/paige/figure.html +++ b/layouts/partials/paige/figure.html @@ -82,7 +82,7 @@ {{ if $table }}
{{ end }} -
{{ $content }}
+
{{ $content }}
{{ with $caption }}
{{ . }}
{{ end }} diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index 1e0c6d24..7e2bbf64 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -7,7 +7,7 @@ {{ $maxwidth := .Get "maxwidth" }} {{ $width := .Get "width" }} -{{ $content = printf `
%v
` $align $content | safeHTML }} +{{ $content = printf `
%v
` $content | safeHTML }} {{ partial "paige/figure.html" (dict "align" $align