If with or heght is set in img and figure shortcodes, use that even when size is set.
This commit is contained in:
parent
b69a268560
commit
fb411d6f32
2 changed files with 14 additions and 4 deletions
|
|
@ -39,8 +39,13 @@
|
|||
{{ if $size -}}
|
||||
{{ $image := $resource.Resize $size -}}
|
||||
{{ $src = $image.RelPermalink -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ if or $width $height -}}
|
||||
{{ $realwidth = $image.Width -}}
|
||||
{{ $realheight = $image.Height -}}
|
||||
{{ else -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ end -}}
|
||||
{{ if $srcset -}}
|
||||
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) -}}
|
||||
{{ end -}}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,13 @@
|
|||
{{ if $size -}}
|
||||
{{ $image := $resource.Resize $size -}}
|
||||
{{ $src = $image.RelPermalink -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ if or $width $height -}}
|
||||
{{ $realwidth = $image.Width -}}
|
||||
{{ $realheight = $image.Height -}}
|
||||
{{ else -}}
|
||||
{{ $width = $image.Width -}}
|
||||
{{ $height = $image.Height -}}
|
||||
{{ end -}}
|
||||
{{ if $srcset -}}
|
||||
{{ $srcsetw = $srcsetw | append (printf "%s %sw" $src (strings.TrimRight "x" $size)) -}}
|
||||
{{ end -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue