From 830c2ba2c6175ac895fdf94a9920386b70f485cc Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sun, 26 Feb 2023 18:10:30 -0800 Subject: [PATCH] Separate figure and quote shortcodes --- README.md | 6 +++--- exampleSite/content/shortcodes/quote.md | 20 +++++++++++------- layouts/partials/paige/style.html | 4 ++++ layouts/shortcodes/paige/quote.html | 28 ++++--------------------- 4 files changed, 24 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index d690a09d..18c38aae 100644 --- a/README.md +++ b/README.md @@ -401,9 +401,7 @@ My content Inner content: Required. String. Markdown. The quotation. -Parameters: - -It has the parameters of the `paige/figure` shortcode. +Parameters: None. ### Code @@ -756,6 +754,8 @@ Use these CSS selectors to extend the default styling:
A page in the pages in the list and term layouts.
.paige-published
Applied to the title of published pages in the list and term layouts.
+
.paige-quote
+
On the root element of the `paige/quote` shortcode.
.paige-section
Appears with .paige-article for a page with kind "section".
.paige-single
diff --git a/exampleSite/content/shortcodes/quote.md b/exampleSite/content/shortcodes/quote.md index e66b6e46..2a8951fa 100644 --- a/exampleSite/content/shortcodes/quote.md +++ b/exampleSite/content/shortcodes/quote.md @@ -11,32 +11,38 @@ Paige provides a `paige/quote` shortcode for displaying a quotation. +## Basic + Code: ```go-text-template {{}} -Don't believe everything you read on the Internet. +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. {{}} ``` Result: {{< paige/quote >}} -Don't believe everything you read on the Internet. +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. {{< /paige/quote >}} ---- +## Figure Code: ```go-text-template -{{}} -Don't believe everything you read on the Internet. +{{}} +{{}} +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. {{}} +{{}} ``` Result: -{{< paige/quote caption="Abraham Lincoln" >}} -Don't believe everything you read on the Internet. +{{< paige/figure caption="Hickory Dickory Dock" >}} +{{< paige/quote >}} +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. {{< /paige/quote >}} +{{< /paige/figure >}} diff --git a/layouts/partials/paige/style.html b/layouts/partials/paige/style.html index 08b846e3..ab87687a 100644 --- a/layouts/partials/paige/style.html +++ b/layouts/partials/paige/style.html @@ -47,6 +47,10 @@ body, html { margin-bottom: 0; } +.paige-figure .paige-quote > blockquote { + margin-bottom: 0; +} + .paige-header-link { margin-left: 0.5ch; opacity: 0; diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index f3c8c5af..abf70e35 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -1,25 +1,5 @@ -{{ $caption := .Get 0 | default (.Get "caption") }} -{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" }} -{{ $float := .Get "float" }} -{{ $height := .Get "height" }} -{{ $horizontal := .Get "horizontal" }} -{{ $maxwidth := .Get "maxwidth" }} -{{ $number := .Get "number" }} -{{ $numbered := .Get "numbered" }} -{{ $vertical := .Get "vertical" }} -{{ $width := .Get "width" }} +{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }} -{{ $content = printf `
%v
` $content }} - -{{ partial "paige/figure.html" (dict - "caption" $caption - "content" $content - "float" $float - "height" $height - "horizontal" $horizontal - "maxwidth" $maxwidth - "number" $number - "numbered" $numbered - "vertical" $vertical - "width" $width -) }} +
+
{{ $content }}
+