From 2afcb642db42127459e4c619d3fdee1f951176df Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 13 Oct 2018 21:13:32 +0100 Subject: [PATCH] widgets: Refactor hero Compute image path outside of HTML style element due to Hugo limitation with relURL --- layouts/partials/widgets/hero.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/layouts/partials/widgets/hero.html b/layouts/partials/widgets/hero.html index 70aacf76..078e7953 100644 --- a/layouts/partials/widgets/hero.html +++ b/layouts/partials/widgets/hero.html @@ -2,6 +2,12 @@ {{ $page := .page }} {{ $header := $page.Params.header }} +{{/* Compute image path outside of HTML style element due to Hugo limitation. */}} +{{ $overlay_img := "" }} +{{ if $header.overlay_img }} + {{ $overlay_img = (printf "img/%s" $header.overlay_img) | relURL }} +{{end}} +