diff --git a/layouts/partials/components/hero/index.html b/layouts/partials/components/hero/index.html index a933baf..3033fd5 100644 --- a/layouts/partials/components/hero/index.html +++ b/layouts/partials/components/hero/index.html @@ -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 }} diff --git a/layouts/partials/gallery/list.html b/layouts/partials/gallery/list.html index f45e867..1c518e3 100644 --- a/layouts/partials/gallery/list.html +++ b/layouts/partials/gallery/list.html @@ -3,37 +3,39 @@ {{ range sort .Pages "Date" "desc" }} {{ if not .Params.private }} {{ $hero := partial "components/hero/process.html" .Params.hero }} - {{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }} + {{ if $hero.src }} + {{ $data := partial "components/image/process.html" (dict "page" . "src" $hero.src) }} - {{- $caption := .Title -}} - {{- $title := $hero.title | default $caption | plainify -}} - {{- $alt := $hero.alt | default $title | plainify -}} + {{- $caption := .Title -}} + {{- $title := $hero.title | default $caption | plainify -}} + {{- $alt := $hero.alt | default $title | plainify -}} -