Look for hero image in page bundle (#684)
Signed-off-by: hossainemruz <hossainemruz@gmail.com> Signed-off-by: hossainemruz <hossainemruz@gmail.com>
This commit is contained in:
parent
a16652581b
commit
c3f0bd449e
1 changed files with 6 additions and 1 deletions
|
@ -3,7 +3,12 @@
|
||||||
|
|
||||||
{{/* if hero image is specified in the page front-matter, then use that */}}
|
{{/* if hero image is specified in the page front-matter, then use that */}}
|
||||||
{{ if .Params.hero }}
|
{{ if .Params.hero }}
|
||||||
{{ $heroImage = resources.Get .Params.hero }}
|
{{/* try to read from the page bundle */}}
|
||||||
|
{{ $heroImage = .Resources.Get .Params.hero }}
|
||||||
|
{{/* if the image does not exist in the page bundle,try looking in the assets folder */}}
|
||||||
|
{{ if not $heroImage }}
|
||||||
|
{{ $heroImage = resources.Get .Params.hero }}
|
||||||
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ .Scratch.Set "heroScratch" $heroImage }}
|
{{ .Scratch.Set "heroScratch" $heroImage }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue