diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/partials/helpers/get-hero.html | 5 |
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 */}} |