diff --git a/layouts/partials/author-extra.html b/layouts/partials/author-extra.html index de97e797..508383a5 100644 --- a/layouts/partials/author-extra.html +++ b/layouts/partials/author-extra.html @@ -9,15 +9,18 @@ {{ end }} {{ if $authorImage }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill "192x192" }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ end }} {{ end }}
diff --git a/layouts/partials/author.html b/layouts/partials/author.html index 57d8088c..ab0fe327 100644 --- a/layouts/partials/author.html +++ b/layouts/partials/author.html @@ -9,8 +9,11 @@ {{ end }} {{ if $authorImage }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill "192x192" }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} {{ $.Site.Params.Author.name | default + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ else }} {{ $authorImage := resources.GetRemote . }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill "192x192" }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} {{ $.Site.Params.Author.name | default + src="{{ $final.RelPermalink }}" + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ end }} {{ end }}
diff --git a/layouts/partials/home/background.html b/layouts/partials/home/background.html index 5afa4647..a46b5d92 100644 --- a/layouts/partials/home/background.html +++ b/layouts/partials/home/background.html @@ -51,8 +51,11 @@ {{ end }} {{ if $authorImage }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} {{ $.Site.Params.Author.name | default `Author` }} + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ end }} {{ end }}

diff --git a/layouts/partials/home/hero.html b/layouts/partials/home/hero.html index 0652c5e7..ed6d81ae 100644 --- a/layouts/partials/home/hero.html +++ b/layouts/partials/home/hero.html @@ -54,8 +54,11 @@ {{ end }} {{ if $authorImage }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} {{ $.Site.Params.Author.name | default `Author` }} + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ end }} {{ end }} {{ if not $disableHeroImageFilter }} diff --git a/layouts/partials/home/profile.html b/layouts/partials/home/profile.html index 7866f9c4..2d27bf68 100644 --- a/layouts/partials/home/profile.html +++ b/layouts/partials/home/profile.html @@ -13,8 +13,11 @@ {{ end }} {{ if $authorImage }} {{ $final := $authorImage }} + {{ $squareImage := $authorImage }} {{ if not $disableImageOptimization }} {{ $final = $authorImage.Fill (print "288x288 q" ( $.Site.Params.Author.imagequality | default "96" )) }} + {{ $shortSide := int (math.Min $authorImage.Width $authorImage.Height) }} + {{ $squareImage = $authorImage.Crop (printf "%dx%d" $shortSide $shortSide ) }} {{ end }} {{ $.Site.Params.Author.name | default `Author` }} + data-zoom-src="{{ $squareImage.RelPermalink }}"> {{ end }} {{ end }}