From fe04cf84b994ef3db80f788b8f5c1bcc829d9d5a Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Tue, 4 Oct 2016 16:33:51 +0200 Subject: [PATCH] contact.html: Shorten code for autolinks (#49) Signed-off-by: Stephan Kulla --- layouts/partials/widgets/contact.html | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/layouts/partials/widgets/contact.html b/layouts/partials/widgets/contact.html index b50220fe..fc298e7a 100644 --- a/layouts/partials/widgets/contact.html +++ b/layouts/partials/widgets/contact.html @@ -1,5 +1,6 @@ {{ $ := .root }} {{ $page := .page }} +{{ $autolink := default true $page.Params.autolink }}
@@ -18,11 +19,9 @@ {{ with $.Site.Params.email }}
  • - {{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }} - {{ . }} - {{ else }} - {{ . }} - {{ end }} + + {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} +
  • {{ end }} @@ -38,11 +37,9 @@ {{ with $.Site.Params.phone }}
  • - {{ if and (isset $.Params "autolink") (eq $.Params.autolink false) }} - {{ . }} - {{ else }} - {{ . }} - {{ end }} + + {{- if $autolink }}{{ . }}{{ else }}{{ . }}{{ end -}} +
  • {{ end }}