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" . }}
|
{{ partial "components/meta/index.html" . }}
|
||||||
|
|
||||||
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
||||||
|
{{ if $hero.src }}
|
||||||
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
|
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
|
||||||
|
|
||||||
{{ $final := merge $data $hero }}
|
{{ $final := merge $data $hero }}
|
||||||
@@ -12,4 +13,5 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ partial "components/image/index.html" $final }}
|
{{ partial "components/image/index.html" $final }}
|
||||||
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
{{ range sort .Pages "Date" "desc" }}
|
{{ range sort .Pages "Date" "desc" }}
|
||||||
{{ if not .Params.private }}
|
{{ if not .Params.private }}
|
||||||
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
{{ $hero := partial "components/hero/process.html" .Params.hero }}
|
||||||
|
{{ if $hero.src }}
|
||||||
{{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }}
|
{{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }}
|
||||||
|
|
||||||
{{- $caption := .Title -}}
|
{{- $caption := .Title -}}
|
||||||
@@ -36,4 +37,5 @@
|
|||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user