Separate figure and image shortcodes

This commit is contained in:
Will Faught
2023-02-27 21:08:03 -08:00
parent c044080791
commit 869505dcd7
4 changed files with 121 additions and 35 deletions

View File

@@ -1,36 +1,31 @@
{{ $alt := .Get "alt" }}
{{ $caption := .Get "caption" }}
{{ $float := .Get "float" }}
{{ $height := .Get "height" }}
{{ $horizontal := .Get "horizontal" }}
{{ $link := .Get "link" }}
{{ $maxwidth := .Get "maxwidth" }}
{{ $height := .Get "height" }}
{{ $method := .Get "method" }}
{{ $number := .Get "number" }}
{{ $numbered := .Get "numbered" }}
{{ $options := .Get "options" }}
{{ $raw := .Get "raw" }}
{{ $src := .Get 0 | default (.Get "src") }}
{{ $title := .Get "title" }}
{{ $vertical := .Get "vertical" }}
{{ $width := .Get "width" }}
{{ partial "paige/image-figure.html" (dict
{{ $content := partial "paige/img.html" (dict
"alt" $alt
"caption" $caption
"float" $float
"gap" 2
"class" "img-fluid"
"height" $height
"horizontal" $horizontal
"link" $link
"maxwidth" $maxwidth
"method" $method
"number" $number
"numbered" $numbered
"options" $options
"page" .Page
"raw" $raw
"src" $src
"title" $title
"vertical" $vertical
"width" $width
) }}
{{ if $link }}
{{ $content = partial "paige/a.html" (dict
"content" $content
"href" $link
) }}
{{ end }}
<div class="paige-image">{{ $content }}</div>