From d48686732686747f7625d498788376d68d4c831d Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sat, 14 Sep 2019 21:51:33 +0100 Subject: [PATCH] fix: don't show address in Contact if it's slice of empty strings An alternative is to comment out the `address` in Params if it's unused. --- layouts/partials/widgets/contact.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index 9ad0230e..11be65fb 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -64,7 +64,7 @@ {{ end }} {{ $addr_formatted := "" }}{{/* Scoping for maps. */}} - {{ if $data.address }} + {{ if $data.address.street | or $data.address.city | or $data.address.region | or $data.address.postcode | or $data.address.country }} {{ $addr := slice }} {{with $data.address.street}}{{$addr = $addr | append .}}{{end}} {{with $data.address.city}}{{$addr = $addr | append .}}{{end}}