diff --git a/layouts/_partials/cover.html b/layouts/_partials/cover.html index 460e490e..0403b0b8 100644 --- a/layouts/_partials/cover.html +++ b/layouts/_partials/cover.html @@ -7,9 +7,10 @@ {{- $alt := (.Params.cover.alt | default .Params.cover.caption | plainify) }} {{- $responsiveImages := (.Params.cover.responsiveImages | default site.Params.cover.responsiveImages) | default true }} - {{- $pageBundleCover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} - {{- $globalResourcesCover := (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} - {{- $cover := (or $pageBundleCover $globalResourcesCover)}} + {{- $cover := (.Resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} + {{- if not $cover }} + {{- $cover = (resources.ByType "image").GetMatch (printf "*%s*" (.Params.cover.image)) }} + {{- end }} {{- /* We are not using the .Param.cover.relative to decide the location of image */}} {{- /* If we have the image in pageBundle or globalResources we can process the image */}}