diff options
author | Troy Lindsay <tlindsay42@users.noreply.github.com> | 2022-01-12 20:16:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-12 20:16:02 +0300 |
commit | 36c029abb9551e247e83789d6b3a02c2299a14e1 (patch) | |
tree | 0df10453141404c8d17ea265cca7927138803679 | |
parent | 3789b8edae1b46e5f91031037f4f9d33972377d3 (diff) |
Fix support for site config featured image (#489) (#490)
* Unintentionally caused by #474
-rw-r--r-- | layouts/partials/func/GetFeaturedImage.html | 7 |
1 files changed, 7 insertions, 0 deletions
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 }}
|