From cfba78c33890e59b95ae8d1ca84215e7d80e6c87 Mon Sep 17 00:00:00 2001 From: Will Faught Date: Sat, 4 Mar 2023 11:44:24 -0800 Subject: [PATCH] Add quote cite param --- exampleSite/content/shortcodes/quote.md | 16 ++++++++++++++++ layouts/shortcodes/paige/quote.html | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/exampleSite/content/shortcodes/quote.md b/exampleSite/content/shortcodes/quote.md index 2a8951fa..dcb0cc69 100644 --- a/exampleSite/content/shortcodes/quote.md +++ b/exampleSite/content/shortcodes/quote.md @@ -27,6 +27,22 @@ Result: Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. {{< /paige/quote >}} +## Cite + +Code: + +```go-text-template +{{}} +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. +{{}} +``` + +Result: + +{{< paige/quote cite="Hickory Dickory Dock" >}} +Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock. +{{< /paige/quote >}} + ## Figure Code: diff --git a/layouts/shortcodes/paige/quote.html b/layouts/shortcodes/paige/quote.html index 58bfabe5..9d7b75d5 100644 --- a/layouts/shortcodes/paige/quote.html +++ b/layouts/shortcodes/paige/quote.html @@ -1,3 +1,4 @@ +{{ $cite := .Get 0 | default (.Get "cite") }} {{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }} {{ if not $content }} @@ -6,4 +7,8 @@
{{ $content }}
+ + {{ with $cite }} + + {{ end }}