Keep backward compatibility

Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
hossainemruz 2021-03-13 19:45:19 +06:00
parent e1618eebc7
commit 7fdeaec2b0

View file

@ -1,5 +1,10 @@
{{/* check if there is any hero image in the same folder as the markdown file */}} {{/* check if there is any hero image in the same folder as the markdown file */}}
{{ $heroImage := .Page.Resources.GetMatch .Params.hero}} {{ $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 }} {{ .Scratch.Set "heroScratch" $heroImage }}
{{/* if hero image is not provided, then use the default hero image */}} {{/* if hero image is not provided, then use the default hero image */}}