Default featured image

This commit is contained in:
Nuno Coração
2023-04-29 12:08:08 +01:00
parent ca81165e93
commit 53e6a6a45b
8 changed files with 10 additions and 5 deletions

View File

@@ -40,6 +40,7 @@
{{- $images := $.Resources.ByType "image" -}}
{{- $featured := $images.GetMatch "*feature*" -}}
{{- if not $featured }}{{ $featured = $images.GetMatch "{*cover*,*thumbnail*}" }}{{ end -}}
{{- if not $featured }}{{ with .Site.Params.defaultFeaturedImage }}{{ $featured = resources.Get . }}{{ end }}{{ end -}}
{{- with $featured -}}
{{ if $disableImageOptimization }}
{{ with . }}