diff --git a/wowchemy/layouts/partials/widgets/hero.html b/wowchemy/layouts/partials/widgets/hero.html index b7fd9ffc..4a7f0321 100644 --- a/wowchemy/layouts/partials/widgets/hero.html +++ b/wowchemy/layouts/partials/widgets/hero.html @@ -4,15 +4,15 @@ {{ if $page.Params.hero_media }}
-
+
{{ end }} -

- {{ with $page.Title }}{{ . | markdownify }}{{ end }} -

+ {{ with $page.Title }} +

{{ . | markdownify }}

+ {{ end }} {{ with $page.Content }} -
{{ . }}
+
{{ . }}
{{ end }} {{/* Call-to-action link */}} @@ -58,8 +58,11 @@ {{/* Hero image */}} {{ if $page.Params.hero_media }}
-
- {{ $image := $page.Parent.Resources.GetMatch $page.Params.hero_media }} +
+ {{- $image := ($page.Parent.Resources.ByType "image").GetMatch $page.Params.hero_media -}} + {{- if not $image -}} + {{- $image = resources.Get (path.Join "media" $page.Params.hero_media) -}} + {{- end -}} {{ if $image }} {{ $legacy_img := $image.Resize "400x" }} {{ $img_src := "" }} @@ -76,9 +79,6 @@ {{ $img_src_set = delimit $img_src_set "," }} {{ $page.Title }} - {{ else }} - {{ $media_dir := $.Scratch.Get "media_dir" }} - {{ $page.Title }} {{ end }}