Browse Source

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.
George Cushen 5 năm trước cách đây
mục cha
commit
d486867326
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      layouts/partials/widgets/contact.html

+ 1 - 1
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}}