Fix crash on missing hero
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{{ partial "components/meta/index.html" . }}
|
||||
|
||||
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
||||
{{ if $hero.src }}
|
||||
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
|
||||
|
||||
{{ $final := merge $data $hero }}
|
||||
@@ -12,4 +13,5 @@
|
||||
{{ end }}
|
||||
|
||||
{{ partial "components/image/index.html" $final }}
|
||||
{{ end }}
|
||||
</section>
|
||||
|
@@ -3,6 +3,7 @@
|
||||
{{ range sort .Pages "Date" "desc" }}
|
||||
{{ if not .Params.private }}
|
||||
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
||||
{{ if $hero.src }}
|
||||
{{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }}
|
||||
|
||||
{{- $caption := .Title -}}
|
||||
@@ -36,4 +37,5 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user