Use img.html directly if no caption

master
Will Faught 3 years ago
parent ec7a5138a3
commit dc87c07b24

@ -195,6 +195,15 @@ Result:
## Customization ## Customization
{{< paige/gallery caption="X image" >}}
{{< paige/gallery image="*-1*.jpg" height="10rem" />}}
{{< paige/gallery image="*-1*.jpg" height="10rem" />}}
{{< paige/gallery image="*-1*.jpg" height="10rem" />}}
{{< paige/gallery image="*-1*.jpg" height="10rem" />}}
{{< /paige/gallery >}}
---
Code: Code:
```go-text-template ```go-text-template

@ -24,6 +24,7 @@
{{ $link = $resource.RelPermalink }} {{ $link = $resource.RelPermalink }}
{{ end }} {{ end }}
{{ if $caption }}
{{ partial "paige/image-figure.html" (dict {{ partial "paige/image-figure.html" (dict
"caption" $caption "caption" $caption
"compact" true "compact" true
@ -40,6 +41,22 @@
"table" true "table" true
"width" $width "width" $width
) }} ) }}
{{ else }}
{{ partial "paige/a.html" (dict
"content" (partial "paige/img.html" (dict
"class" "img-fluid"
"height" $height
"maxheight" $maxheight
"maxwidth" $maxwidth
"method" $method
"options" $options
"resource" $resource
"src" $image
"width" $width
))
"href" $link
) }}
{{ end }}
{{ else }} {{ else }}
{{ $inner := chomp .Inner }} {{ $inner := chomp .Inner }}

Loading…
Cancel
Save