fix(profile): fix social link when mailto scheme is used

Fix #763
This commit is contained in:
George Cushen committed 2018-10-28 14:16:37 +00:00
1 parent 75abb65a94
commit 8a4a302d47
2 files changed
+12 -6

No files matched your search

+5 -2
View File
@@ -25,11 +25,14 @@
{{ $pack_prefix = "fa" }}
{{ end }}
{{ $target := "target=\"_blank\" rel=\"noopener\"" }}
{{ if not (urls.Parse .link).Scheme }}
{{ $link := .link }}
{{ $scheme := (urls.Parse $link).Scheme }}
{{ if not $scheme }}
{{ $target = "" }}
{{ $link = .link | relLangURL }}
{{ end }}
<li>
<a itemprop="sameAs" href="{{ .link | relLangURL | safeURL }}" {{ $target | safeHTMLAttr }}>
<a itemprop="sameAs" href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>
<i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }}"></i>
</a>
</li>
+7 -4
View File
@@ -44,12 +44,15 @@
{{ $pack_prefix = "fa" }}
{{ end }}
{{ $target := "target=\"_blank\" rel=\"noopener\"" }}
{{ if not (urls.Parse .link).Scheme }}
{{ $target = "" }}
{{ $link := .link }}
{{ $scheme := (urls.Parse $link).Scheme }}
{{ if not $scheme }}
{{ $target = "" }}
{{ $link = .link | relLangURL }}
{{ end }}
<li>
<a itemprop="sameAs" href="{{ .link | relLangURL | safeURL }}" {{ $target | safeHTMLAttr }}>
<i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} big-icon"></i>
<a itemprop="sameAs" href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>
<i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} big-icon"></i>{{ $scheme }}
</a>
</li>
{{ end }}