Separate figure and quote shortcodes
This commit is contained in:
		| @@ -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: | ||||
|     <dd>A page in the pages in the list and term layouts.</dd> | ||||
|     <dt><code>.paige-published</code></dt> | ||||
|     <dd>Applied to the title of published pages in the list and term layouts.</dd> | ||||
|     <dt><code>.paige-quote</code></dt> | ||||
|     <dd>On the root element of the `paige/quote` shortcode.</dd> | ||||
|     <dt><code>.paige-section</code></dt> | ||||
|     <dd>Appears with <code>.paige-article</code> for a page with kind "section".</dd> | ||||
|     <dt><code>.paige-single</code></dt> | ||||
|   | ||||
| @@ -11,32 +11,38 @@ Paige provides a `paige/quote` shortcode for displaying a quotation. | ||||
|  | ||||
| <!--more--> | ||||
|  | ||||
| ## Basic | ||||
|  | ||||
| Code: | ||||
|  | ||||
| ```go-text-template | ||||
| {{</* paige/quote */>}} | ||||
| Don't believe everything you read on the Internet. | ||||
| 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 >}} | ||||
| Don't believe everything you read on the Internet. | ||||
| 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: | ||||
|  | ||||
| ```go-text-template | ||||
| {{</* 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.<br>The mouse ran up the clock.<br>The clock struck one,<br>The mouse ran down,<br>Hickory dickory dock. | ||||
| {{</* /paige/quote */>}} | ||||
| {{</* /paige/figure */>}} | ||||
| ``` | ||||
|  | ||||
| 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.<br>The mouse ran up the clock.<br>The clock struck one,<br>The mouse ran down,<br>Hickory dickory dock. | ||||
| {{< /paige/quote >}} | ||||
| {{< /paige/figure >}} | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
| @@ -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 `<blockquote class="blockquote mb-0">%v</blockquote>` $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 | ||||
| ) }} | ||||
| <div class="paige-quote"> | ||||
|     <blockquote class="blockquote">{{ $content }}</blockquote> | ||||
| </div> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user