diff --git a/layouts/partials/GetImageDirection b/layouts/partials/GetImageDirection index da1d8e3b41cda6e85f618943394550b07996a70a..664e9485d1b17ccfd2bf2d973ab3d8b3deebf0ca 100644 --- a/layouts/partials/GetImageDirection +++ b/layouts/partials/GetImageDirection @@ -1,9 +1,8 @@ -{{ $ratio := partial "GetImageRatio" . }} {{ $direction := "square" }} -{{ if gt $ratio 1 }} +{{ if gt .ratio 1 }} {{ $direction = "landscape" }} -{{ else if lt $ratio 1 }} +{{ else if lt .ratio 1 }} {{ $direction = "portrait" }} {{ end }} diff --git a/layouts/partials/GetImageRatio b/layouts/partials/GetImageRatio deleted file mode 100644 index b17f0b3dd54aa045ee1d273ded25538d8574d6ff..0000000000000000000000000000000000000000 --- a/layouts/partials/GetImageRatio +++ /dev/null @@ -1,10 +0,0 @@ -{{ $image := partial "GetMedia" .id }} -{{ $ratio := 1 }} - -{{ if $image }} - {{ if and $image.width $image.height }} - {{ $ratio = div (float $image.width) (float $image.height) }} - {{ end }} -{{ end }} - -{{ return $ratio }} \ No newline at end of file