Add preprocessing images for person lists

This commit is contained in:
Christian Wolf 2024-01-14 23:18:19 +01:00
parent c2aeb42a85
commit cbc59e4303
2 changed files with 6 additions and 6 deletions

View File

@ -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" }}

View File

@ -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" }}