Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/hossainemruz/toha.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid G. Simmons <davidgs@users.noreply.github.com>2021-03-13 16:48:52 +0300
committerGitHub <noreply@github.com>2021-03-13 16:48:52 +0300
commit88895c50c2b7c390a454ff376f5f9083f163df8a (patch)
treeb7e99f8f7b683dc2dbbd0e2200f142fcae521f26 /layouts
parent4bea73b88214c85678a5352da1786e4e9123b44d (diff)
Fix to the hero so you can have the image named anything you want (#248)
* Fix to the hero so you can have the image named anything you want * Keep backward compatibility Signed-off-by: hossainemruz <hossainemruz@gmail.com> Co-authored-by: hossainemruz <hossainemruz@gmail.com>
Diffstat (limited to 'layouts')
-rw-r--r--layouts/partials/helpers/get-hero.html5
1 files changed, 5 insertions, 0 deletions
diff --git a/layouts/partials/helpers/get-hero.html b/layouts/partials/helpers/get-hero.html
index 0a10d0a..d253f85 100644
--- a/layouts/partials/helpers/get-hero.html
+++ b/layouts/partials/helpers/get-hero.html
@@ -1,5 +1,10 @@
{{/* check if there is any hero image in the same folder as the markdown file */}}
{{ $heroImage := .Page.Resources.GetMatch "hero.{jpg,png,svg}"}}
+
+{{/* if hero image is specified in the page front-matter, then use that */}}
+{{ if .Params.hero }}
+ {{ $heroImage = .Page.Resources.GetMatch .Params.hero }}
+{{ end }}
{{ .Scratch.Set "heroScratch" $heroImage }}
{{/* if hero image is not provided, then use the default hero image */}}