From fa5de9234dd47b1f30e334191f5df43bca322be5 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Thu, 25 Oct 2018 20:22:03 +0100 Subject: [PATCH] feat(profile): support [[params.social]] links to homepage sections Enables using email icon to link to contact form. Close #754 --- exampleSite/config.toml | 6 +++--- layouts/partials/page_author.html | 8 ++++++-- layouts/partials/widgets/about.html | 6 +++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index e7c4b4a9..e818a779 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -247,12 +247,12 @@ enableGitInfo = false [[params.social]] icon = "envelope" icon_pack = "fas" - link = "mailto:test@example.org" + link = "#contact" # For a direct email link, use "mailto:test@example.org". [[params.social]] icon = "twitter" icon_pack = "fab" - link = "//twitter.com/GeorgeCushen" + link = "https://twitter.com/GeorgeCushen" [[params.social]] icon = "google-scholar" @@ -262,7 +262,7 @@ enableGitInfo = false [[params.social]] icon = "github" icon_pack = "fab" - link = "//github.com/gcushen" + link = "https://github.com/gcushen" # Link to a PDF of your resume/CV from the About widget. # To enable, copy your resume/CV to `static/files/cv.pdf` and uncomment the lines below. diff --git a/layouts/partials/page_author.html b/layouts/partials/page_author.html index 010a380f..8df18b3c 100644 --- a/layouts/partials/page_author.html +++ b/layouts/partials/page_author.html @@ -22,10 +22,14 @@ {{ $pack := or .icon_pack "fas" }} {{ $pack_prefix := $pack }} {{ if in (slice "fab" "fas" "far" "fal") $pack }} - {{ $pack_prefix = "fa" }} + {{ $pack_prefix = "fa" }} + {{ end }} + {{ $target := "target=\"_blank\" rel=\"noopener\"" }} + {{ if not (urls.Parse .link).Scheme }} + {{ $target = "" }} {{ end }}
  • - +
  • diff --git a/layouts/partials/widgets/about.html b/layouts/partials/widgets/about.html index 03ffc665..df773a39 100644 --- a/layouts/partials/widgets/about.html +++ b/layouts/partials/widgets/about.html @@ -43,8 +43,12 @@ {{ if in (slice "fab" "fas" "far" "fal") $pack }} {{ $pack_prefix = "fa" }} {{ end }} + {{ $target := "target=\"_blank\" rel=\"noopener\"" }} + {{ if not (urls.Parse .link).Scheme }} + {{ $target = "" }} + {{ end }}
  • - +