From 00eb0180d53753653402cbc1978bb2ca56d2059a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kantoj=C3=A4rvi?= Date: Thu, 4 Mar 2021 01:27:21 +0200 Subject: [PATCH] Render contact links on a single line --- assets/css/_layout.scss | 4 ++++ layouts/partials/header.html | 29 ++++++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/assets/css/_layout.scss b/assets/css/_layout.scss index fa36033..b1bd8ee 100644 --- a/assets/css/_layout.scss +++ b/assets/css/_layout.scss @@ -99,6 +99,10 @@ main.paper { -o-border-radius: 50%; border-radius: 50%; } + + a i { + padding: 0; + } } .left-column, .right-column { diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2ac03c4..3ddbd6b 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -2,11 +2,30 @@ {{ with .Data.features.about }}

{{ .name }}

{{ if $.Header.tagline }}

{{ .tagline }}

{{end}} - {{ if $.Header.contact }}{{ .phone }} | {{ .email }}{{ end }} - {{ if $.Header.links }} - {{ range .links }} - {{ if and $.useFontAwesome .icon }}{{ end }}{{ .title }} - {{ end }} + {{ if $.Header.contact -}} + + {{- with .phone -}} + {{- if $.useFontAwesome }} {{ end -}} + {{- . -}} + {{- end -}} + {{- if and .phone .email }} | {{ end -}} + {{- with .email -}} + {{- if $.useFontAwesome }} {{ end -}} + {{- . -}} + {{- end -}} + + {{- end }} + {{ if $.Header.links -}} + + {{- $last := sub (len .links) 1 -}} + {{- range $i, $e := .links -}} + + {{- if and $e.icon $.useFontAwesome }} {{ end -}} + {{- $e.title -}} + + {{- if ne $i $last }} | {{ end -}} + {{- end -}} + {{ end }} {{ end }}