Replace use of add with path.Join for buildig paths.
This commit is contained in:
parent
4336c6b036
commit
56d3c30a98
1 changed files with 13 additions and 13 deletions
|
|
@ -10,7 +10,7 @@
|
|||
{{ $maxwidth := site.Params.imageMaxWidth -}}
|
||||
{{ $realwidth := 0 -}}
|
||||
{{ $realheight := 0 -}}
|
||||
{{ if and $src (fileExists (add "/assets" $src)) -}}
|
||||
{{ if and $src (fileExists (path.Join "/assets" $src)) -}}
|
||||
{{ $original := resources.Get $src -}}
|
||||
{{ if $size -}}
|
||||
{{ $image := $original.Resize $size -}}
|
||||
|
|
@ -30,8 +30,8 @@
|
|||
{{ $width = "" -}}
|
||||
{{ $height = "" -}}
|
||||
{{ end -}}
|
||||
{{ else if and $src (fileExists (add "/static" $src)) -}}
|
||||
{{ with (imageConfig (add "/static" $src)) -}}
|
||||
{{ else if and $src (fileExists (path.Join "/static" $src)) -}}
|
||||
{{ with (imageConfig (path.Join "/static" $src)) -}}
|
||||
{{ $realwidth = .Width -}}
|
||||
{{ $realheight = .Height -}}
|
||||
{{ end -}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue