Merge pull request #407 from adir1/main

🐛 added support for heroStyle via front-matter
This commit is contained in:
Nuno Coração 2023-01-08 21:02:36 +00:00 committed by GitHub
commit 9a424d8f06
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,11 @@
<article>
{{ if .Params.showHero | default (.Site.Params.article.showHero | default false) }}
{{ $heroStyle := print "partials/hero/" .Site.Params.article.heroStyle ".html" }}
{{ $heroStyle := .Site.Params.article.heroStyle }}
{{ if .Params.heroStyle }}
{{ $heroStyle = .Params.heroStyle }}
{{ end }}
{{ $heroStyle := print "partials/hero/" $heroStyle ".html" }}
{{ if templates.Exists $heroStyle }}
{{ partial $heroStyle . }}
{{ else }}