forked from tsc-vfl/hugo-page
Add preprocessing images for person lists
This commit is contained in:
parent
c2aeb42a85
commit
cbc59e4303
@ -3,11 +3,11 @@
|
|||||||
{{ $imageName := .Params.image }}
|
{{ $imageName := .Params.image }}
|
||||||
{{ $image := "" }}
|
{{ $image := "" }}
|
||||||
{{ with .Resources.GetMatch $imageName}}
|
{{ with .Resources.GetMatch $imageName}}
|
||||||
{{ $image = .RelPermalink }}
|
{{ $image = (.Fit "60x80 webp").RelPermalink }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }}
|
{{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }}
|
||||||
{{ with .Resources.ByType "image" }}
|
{{ with .Resources.ByType "image" }}
|
||||||
{{ $image = (index . 0).RelPermalink }}
|
{{ $image = ((index . 0).Fit "60x80 webp").RelPermalink }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Params.sex }}
|
{{ with .Params.sex }}
|
||||||
{{ if eq . "male" }}
|
{{ if eq . "male" }}
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
{{ with .GetPage ($.Get "name") }}
|
{{ with .GetPage ($.Get "name") }}
|
||||||
{{ $imageName := .Params.image }}
|
{{ $imageName := .Params.image }}
|
||||||
{{ $image := "" }}
|
{{ $image := "" }}
|
||||||
{{ with .Resources.GetMatch $imageName}}
|
{{ with (.Resources.GetMatch $imageName) }}
|
||||||
{{ $image = .RelPermalink }}
|
{{ $image = (.Fit "60x80 webp").RelPermalink }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }}
|
{{ warnf "Image for %s is not correclty found. Falling back to default." ($.Get "name") }}
|
||||||
{{ with .Resources.ByType "image" }}
|
{{ with (.Resources.ByType "image") }}
|
||||||
{{ $image = (index . 0).RelPermalink }}
|
{{ $image = ((index . 0).Fit "60x80 webp").RelPermalink }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ with .Params.sex }}
|
{{ with .Params.sex }}
|
||||||
{{ if eq . "male" }}
|
{{ if eq . "male" }}
|
||||||
|
Loading…
Reference in New Issue
Block a user