Add base size to srcset in render image example.
This commit is contained in:
parent
5ef856b8c8
commit
d81780b409
1 changed files with 3 additions and 0 deletions
|
|
@ -37,6 +37,9 @@
|
||||||
{{ $src = $image.RelPermalink -}}
|
{{ $src = $image.RelPermalink -}}
|
||||||
{{ $width = $image.Width -}}
|
{{ $width = $image.Width -}}
|
||||||
{{ $height = $image.Height -}}
|
{{ $height = $image.Height -}}
|
||||||
|
{{ if $srcset -}}
|
||||||
|
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) }}
|
||||||
|
{{ end -}}
|
||||||
{{ else -}}
|
{{ else -}}
|
||||||
{{ $src = $resource.RelPermalink -}}
|
{{ $src = $resource.RelPermalink -}}
|
||||||
{{ $realwidth = $resource.Width -}}
|
{{ $realwidth = $resource.Width -}}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue