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 -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ if $srcset -}}
|
||||
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) }}
|
||||
{{ end -}}
|
||||
{{ else -}}
|
||||
{{ $src = $resource.RelPermalink -}}
|
||||
{{ $realwidth = $resource.Width -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue