From cbc59e43039760b32c70cb656598ebb89efe351b Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Sun, 14 Jan 2024 23:18:19 +0100 Subject: [PATCH] Add preprocessing images for person lists --- themes/tsc_vfl/layouts/shortcodes/tsc/trainer.html | 4 ++-- themes/tsc_vfl/layouts/shortcodes/tsc/vorstand.html | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/themes/tsc_vfl/layouts/shortcodes/tsc/trainer.html b/themes/tsc_vfl/layouts/shortcodes/tsc/trainer.html index 3b1f683..603859d 100644 --- a/themes/tsc_vfl/layouts/shortcodes/tsc/trainer.html +++ b/themes/tsc_vfl/layouts/shortcodes/tsc/trainer.html @@ -3,11 +3,11 @@ {{ $imageName := .Params.image }} {{ $image := "" }} {{ with .Resources.GetMatch $imageName}} - {{ $image = .RelPermalink }} + {{ $image = (.Fit "60x80 webp").RelPermalink }} {{ else }} {{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }} {{ with .Resources.ByType "image" }} - {{ $image = (index . 0).RelPermalink }} + {{ $image = ((index . 0).Fit "60x80 webp").RelPermalink }} {{ else }} {{ with .Params.sex }} {{ if eq . "male" }} diff --git a/themes/tsc_vfl/layouts/shortcodes/tsc/vorstand.html b/themes/tsc_vfl/layouts/shortcodes/tsc/vorstand.html index c76cdc7..92ae5f4 100644 --- a/themes/tsc_vfl/layouts/shortcodes/tsc/vorstand.html +++ b/themes/tsc_vfl/layouts/shortcodes/tsc/vorstand.html @@ -2,12 +2,12 @@ {{ with .GetPage ($.Get "name") }} {{ $imageName := .Params.image }} {{ $image := "" }} - {{ with .Resources.GetMatch $imageName}} - {{ $image = .RelPermalink }} + {{ with (.Resources.GetMatch $imageName) }} + {{ $image = (.Fit "60x80 webp").RelPermalink }} {{ else }} {{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }} - {{ with .Resources.ByType "image" }} - {{ $image = (index . 0).RelPermalink }} + {{ with (.Resources.ByType "image") }} + {{ $image = ((index . 0).Fit "60x80 webp").RelPermalink }} {{ else }} {{ with .Params.sex }} {{ if eq . "male" }}