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

@@ -40,8 +40,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 }}
{{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{ if .Params.hideFeatureImage }}{{ $featured = false }}{{ end }}
{{- with $featured -}}