The disableImageOptimization setting now affects author images.

This commit is contained in:
MaikelChan
2023-07-30 20:42:45 +02:00
parent 2c3cbeb0ae
commit a6263505f8
5 changed files with 20 additions and 5 deletions
+4 -1
View File
@@ -1,8 +1,11 @@
{{ $disableImageOptimization := .Site.Params.disableImageOptimization | default false }}
<div class="flex">
{{ with .Site.Author.image }}
{{ $authorImage := resources.Get . }}
{{ if $authorImage }}
{{ $authorImage := $authorImage.Fill "192x192" }}
{{ if not $disableImageOptimization }}
{{ $authorImage = $authorImage.Fill "192x192" }}
{{ end }}
<img class="!mt-0 !mb-0 h-24 w-24 rounded-full ltr:mr-4 rtl:ml-4" width="96" height="96"
alt="{{ $.Site.Author.name | default " Author" }}" src="{{ $authorImage.RelPermalink }}" />
{{ end }}