From ac4dd25cac3b46ceb203678df721730dc8864eab Mon Sep 17 00:00:00 2001 From: Troy Lindsay Date: Tue, 11 Jan 2022 22:33:33 -0600 Subject: [PATCH] Fix support for site config featured image (#489) * Unintentionally caused by #474 --- layouts/partials/func/GetFeaturedImage.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/layouts/partials/func/GetFeaturedImage.html b/layouts/partials/func/GetFeaturedImage.html index 12ffe1c..b33eaa3 100644 --- a/layouts/partials/func/GetFeaturedImage.html +++ b/layouts/partials/func/GetFeaturedImage.html @@ -34,6 +34,13 @@ {{ end }} {{ end }} +{{ if not $linkToCover }} + {{/* Use the value from the site config parameter if present */}} + {{ with .Site.Params.featured_image }} + {{ $linkToCover = . }} + {{ end }} +{{ end }} + {{/* return either a permalink, or an empty string. Note that partials can only have a single return statement, so this needs to be at the end of the partial (and not in the if block) */}} {{ return $linkToCover }}