From 8a4a302d47afaead1d0d415b9584426eb4f8c939 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Sun, 28 Oct 2018 14:16:37 +0000 Subject: [PATCH] fix(profile): fix `social` link when mailto scheme is used Fix #763 --- layouts/partials/page_author.html | 7 +++++-- layouts/partials/widgets/about.html | 11 +++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/layouts/partials/page_author.html b/layouts/partials/page_author.html index 8df18b3c..0a9a928d 100644 --- a/layouts/partials/page_author.html +++ b/layouts/partials/page_author.html @@ -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 }}
  • - +
  • diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index df773a39..1c8430c4 100644 --- a/layouts/partials/widgets/about.html +++ b/layouts/partials/widgets/about.html @@ -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 }}
  • - - + + {{ $scheme }}
  • {{ end }}