Add raw param to image shortcodes

This commit is contained in:
Will Faught
2023-01-15 23:42:03 -08:00
parent 13910ca440
commit c9a9cf9b61
5 changed files with 40 additions and 5 deletions

View File

@@ -8,25 +8,33 @@
{{ $maxwidth := .Get "maxwidth" }}
{{ $method := .Get "method" | default "resize" }}
{{ $options := .Get "options" | default "550x webp picture Lanczos" }}
{{ $raw := .Get "raw" }}
{{ $type := .Get "type" | default "rows" }}
{{ $width := .Get "width" }}
{{ if $image }}
{{ $resource := partial "paige/func-resource.html" (dict
"page" .Page
"url" $image
) }}
{{ $link := $image }}
{{ $resource := "" }}
{{ if not $raw }}
{{ $resource = partial "paige/func-resource.html" (dict
"page" .Page
"url" $image
) }}
{{ $link = $resource.RelPermalink }}
{{ end }}
{{ partial "paige/image-figure.html" (dict
"caption" $caption
"compact" true
"height" $height
"link" $resource.RelPermalink
"link" $link
"maxheight" $maxheight
"maxwidth" $maxwidth
"method" $method
"options" $options
"page" .Page
"raw" $raw
"resource" $resource
"src" $image
"table" true

View File

@@ -8,6 +8,7 @@
{{ $maxwidth := .Get "maxwidth" }}
{{ $method := .Get "method" }}
{{ $options := .Get "options" }}
{{ $raw := .Get "raw" }}
{{ $src := .Get 0 | default (.Get "src") }}
{{ $title := .Get "title" }}
{{ $width := .Get "width" }}
@@ -23,6 +24,7 @@
"maxwidth" $maxwidth
"method" $method
"options" $options
"raw" $raw
"src" $src
"title" $title
"width" $width