Fix crash on missing hero

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-13 23:23:17 +00:00
parent 8834c6dc21
commit d9a3c4b4a1
2 changed files with 37 additions and 33 deletions

View File

@@ -3,13 +3,15 @@
{{ partial "components/meta/index.html" . }}
{{ $hero := partial "components/hero/process.html" .Params.hero }}
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
{{ if $hero.src }}
{{ $data := partial "components/image/process.html" (dict "page" .Page "src" $hero.src) }}
{{ $final := merge $data $hero }}
{{ if $hero.exif }}
{{ $caption := partial "components/image/exif.html" $data.original }}
{{ $final = merge $final (dict "caption" $caption) }}
{{ $final := merge $data $hero }}
{{ if $hero.exif }}
{{ $caption := partial "components/image/exif.html" $data.original }}
{{ $final = merge $final (dict "caption" $caption) }}
{{ end }}
{{ partial "components/image/index.html" $final }}
{{ end }}
{{ partial "components/image/index.html" $final }}
</section>