Add image shortcode params class, fetchpriority, loading
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
{{ $alt := .Get "alt" }}
|
{{ $alt := .Get "alt" }}
|
||||||
{{ $breakpoints := .Get "breakpoints" }}
|
{{ $breakpoints := .Get "breakpoints" }}
|
||||||
|
{{ $class := .Get "class" }}
|
||||||
{{ $densities := .Get "densities" }}
|
{{ $densities := .Get "densities" }}
|
||||||
|
{{ $fetchpriority := .Get "fetchpriority" }}
|
||||||
{{ $height := .Get "height" }}
|
{{ $height := .Get "height" }}
|
||||||
{{ $link := .Get "link" }}
|
{{ $link := .Get "link" }}
|
||||||
|
{{ $loading := .Get "loading" }}
|
||||||
{{ $maxheight := .Get "maxheight" }}
|
{{ $maxheight := .Get "maxheight" }}
|
||||||
{{ $maxwidth := .Get "maxwidth" }}
|
{{ $maxwidth := .Get "maxwidth" }}
|
||||||
{{ $process := .Get "process" }}
|
{{ $process := .Get "process" }}
|
||||||
@@ -16,12 +19,23 @@
|
|||||||
{{ errorf "paige/image: no content" }}
|
{{ errorf "paige/image: no content" }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if $class }}
|
||||||
|
{{ $class = split $class " " }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $class = slice }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ $class = $class | append "img-fluid" | uniq | sort }}
|
||||||
|
{{ $class = delimit $class " " }}
|
||||||
|
|
||||||
{{ $content := partial "paige/img.html" (dict
|
{{ $content := partial "paige/img.html" (dict
|
||||||
"alt" $alt
|
"alt" $alt
|
||||||
"breakpoints" $breakpoints
|
"breakpoints" $breakpoints
|
||||||
"class" "img-fluid"
|
"class" $class
|
||||||
"densities" $densities
|
"densities" $densities
|
||||||
|
"fetchpriority" $fetchpriority
|
||||||
"height" $height
|
"height" $height
|
||||||
|
"loading" $loading
|
||||||
"maxheight" $maxheight
|
"maxheight" $maxheight
|
||||||
"maxwidth" $maxwidth
|
"maxwidth" $maxwidth
|
||||||
"process" $process
|
"process" $process
|
||||||
|
Reference in New Issue
Block a user