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 -}}
|
{{ $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 -}}
|
||||||
|
|
|
||||||
|
|
@ -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