Add quote.html, figure-quote.md

master
Will Faught 3 years ago
parent 954aa2946e
commit 84194f097c

@ -0,0 +1,131 @@
---
categories: [paige]
date: "2023-01-02"
description: Demonstration of the Paige quote shortcode.
tags: [figures, shortcodes]
title: Quote Shortcode
---
Code:
```go-text-template
{{</* paige/quote */>}}
Don't believe everything you read on the Internet.
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote >}}
Don't believe everything you read on the Internet.
{{< /paige/quote >}}
---
Code:
```go-text-template
{{</* paige/quote cite="Abraham Lincoln" */>}}
Don't believe everything you read on the Internet.
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote cite="Abraham Lincoln" >}}
Don't believe everything you read on the Internet.
{{< /paige/quote >}}
---
Code:
```go-text-template
{{</* paige/quote */>}}
Don't believe everything you read on the Internet.
{{</* /paige/quote */>}}
{{</* paige/quote */>}}
Use the Force, Harry.
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote >}}
Don't believe everything you read on the Internet.
{{< /paige/quote >}}
{{< paige/quote >}}
Use the Force, Harry.
{{< /paige/quote >}}
---
Code:
```go-text-template
{{</* paige/quote cite="Abraham Lincoln" */>}}
Don't believe everything you read on the Internet.
{{</* /paige/quote */>}}
{{</* paige/quote cite="Gandalf" */>}}
Use the Force, Harry.
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote cite="Abraham Lincoln" >}}
Don't believe everything you read on the Internet.
{{< /paige/quote >}}
{{< paige/quote cite="Gandalf" >}}
Use the Force, Harry.
{{< /paige/quote >}}
---
Code:
```go-text-template
{{</* paige/quote caption="Hickory Dickory Dock" align="start" */>}}
<pre class="paige-font-inherit">
Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock.
</pre>
{{</* /paige/quote */>}}
{{</* paige/quote cite="Hickory Dickory Dock" align="end" */>}}
<pre class="paige-font-inherit">
Humpty Dumpty sat on a wall,
Humpty Dumpty had a great fall.
All the king's horses and all the king's men
Couldn't put Humpty together again.
</pre>
{{</* /paige/quote */>}}
```
Result:
{{< paige/quote caption="Hickory Dickory Dock" align="start" >}}
<pre class="paige-font-inherit">
Hickory dickory dock.
The mouse ran up the clock.
The clock struck one,
The mouse ran down,
Hickory dickory dock.
</pre>
{{< /paige/quote >}}
{{< paige/quote cite="Hickory Dickory Dock" align="end" >}}
<pre class="paige-font-inherit">
Humpty Dumpty sat on a wall,
Humpty Dumpty had a great fall.
All the king's horses and all the king's men
Couldn't put Humpty together again.
</pre>
{{< /paige/quote >}}

@ -0,0 +1,19 @@
{{ $align := .Get "align" | default "center" }}
{{ $caption := .Get "caption" }}
{{ $cite := .Get 0 | default (.Get "cite") }}
{{ $caption = $caption | markdownify }}
{{ $cite = $cite | markdownify }}
{{ $content := .Inner | markdownify }}
<figure class="d-flex align-items-center flex-column paige-figure">
<div>
<blockquote class="blockquote {{ if $caption }} mb-2 {{ end }} text-{{ $align }}">{{ $content }}</blockquote>
{{ with $caption }}
<figcaption class="figure-caption text-center">{{ . }}</figcaption>
{{ end }}
{{ with $cite }}
<figcaption class="blockquote-footer figure-caption text-{{ $align }}">{{ . }}</figcaption>
{{ end }}
</div>
</figure>
Loading…
Cancel
Save