You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.3 KiB
HTML
58 lines
1.3 KiB
HTML
{{ $alt := .Get "alt" }}
|
|
{{ $breakpoints := .Get "breakpoints" }}
|
|
{{ $class := .Get "class" }}
|
|
{{ $densities := .Get "densities" }}
|
|
{{ $fetchpriority := .Get "fetchpriority" }}
|
|
{{ $height := .Get "height" }}
|
|
{{ $link := .Get "link" }}
|
|
{{ $loading := .Get "loading" }}
|
|
{{ $maxheight := .Get "maxheight" }}
|
|
{{ $maxwidth := .Get "maxwidth" }}
|
|
{{ $process := .Get "process" }}
|
|
{{ $sizes := .Get "sizes" }}
|
|
{{ $src := .Get 0 | default (.Get "src") }}
|
|
{{ $srcset := .Get "srcset" }}
|
|
{{ $title := .Get "title" }}
|
|
{{ $width := .Get "width" }}
|
|
|
|
{{ if not $src }}
|
|
{{ errorf "paige/image: no src" }}
|
|
{{ 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
|
|
"alt" $alt
|
|
"breakpoints" $breakpoints
|
|
"class" $class
|
|
"densities" $densities
|
|
"fetchpriority" $fetchpriority
|
|
"height" $height
|
|
"loading" $loading
|
|
"maxheight" $maxheight
|
|
"maxwidth" $maxwidth
|
|
"process" $process
|
|
"page" .Page
|
|
"sizes" $sizes
|
|
"src" $src
|
|
"srcset" $srcset
|
|
"title" $title
|
|
"width" $width
|
|
) }}
|
|
|
|
{{ if $link }}
|
|
{{ $content = partial "paige/a.html" (dict
|
|
"content" $content
|
|
"href" $link
|
|
) }}
|
|
{{ end }}
|
|
|
|
<div class="paige-image">{{ $content }}</div>
|