Add quote cite param

This commit is contained in:
Will Faught
2023-03-04 11:44:24 -08:00
parent fed1ee0a3b
commit cfba78c338
2 changed files with 21 additions and 0 deletions

View File

@@ -27,6 +27,22 @@ Result:
Hickory dickory dock.<br>The mouse ran up the clock.<br>The clock struck one,<br>The mouse ran down,<br>Hickory dickory dock.
{{< /paige/quote >}}
## Cite
Code:
```go-text-template
{{</* paige/quote cite="Hickory Dickory Dock" */>}}
Hickory dickory dock.<br>The mouse ran up the clock.<br>The clock struck one,<br>The mouse ran down,<br>Hickory dickory dock.
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote cite="Hickory Dickory Dock" >}}
Hickory dickory dock.<br>The mouse ran up the clock.<br>The clock struck one,<br>The mouse ran down,<br>Hickory dickory dock.
{{< /paige/quote >}}
## Figure
Code:

View File

@@ -1,3 +1,4 @@
{{ $cite := .Get 0 | default (.Get "cite") }}
{{ $content := .Inner | replaceRE "^\n" "" | replaceRE "\n$" "" | markdownify }}
{{ if not $content }}
@@ -6,4 +7,8 @@
<div class="paige-quote">
<blockquote class="blockquote">{{ $content }}</blockquote>
{{ with $cite }}
<div class="blockquote-footer">{{ . }}</div>
{{ end }}
</div>