Add base size to srcset in img and figure shortcodes.
This commit is contained in:
parent
c909fa8139
commit
32a815789c
2 changed files with 6 additions and 0 deletions
|
|
@ -41,6 +41,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 -}}
|
||||
|
|
|
|||
|
|
@ -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