Ensure featureimage is present before calling resources.GetRemote

Also added ability to set author image as external url and updated
relevant documentation in configuration
This commit is contained in:
Aakash Nand
2024-02-10 23:04:54 +09:00
parent 289b3ff7ad
commit 19520b4481
11 changed files with 95 additions and 37 deletions

View File

@@ -3,6 +3,10 @@
{{- $images := .Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{ if .Params.featureimage }}
{{- $url:= .Params.featureimage -}}
{{- if not $featured }}{{ $featured = resources.GetRemote $url }}{{ end -}}
{{ end }}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}