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 committed 2024-02-10 23:52:52 +09:00
1 parent 289b3ff7ad
commit 19520b4481
11 files changed
+95 -37

No files matched your search

+4
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 . }}