From c23c5f93cde9f98534f2d89e46739a3d35b6239a Mon Sep 17 00:00:00 2001 From: Oscar Najera Date: Sun, 15 Oct 2023 23:33:32 +0200 Subject: Social links --- layouts/partials/social_links.html | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 layouts/partials/social_links.html (limited to 'layouts/partials/social_links.html') diff --git a/layouts/partials/social_links.html b/layouts/partials/social_links.html new file mode 100644 index 0000000..e06fade --- /dev/null +++ b/layouts/partials/social_links.html @@ -0,0 +1,22 @@ +{{ range .Params.social }} + {{ $pack := or .icon_pack "fas" }} + {{ $pack_prefix := $pack }} + {{ if in (slice "fab" "fas" "far" "fal") $pack }} + {{ $pack_prefix = "fa" }} + {{ end }} + {{ $link := .link }} + {{ $scheme := (urls.Parse $link).Scheme }} + {{ $target := "" }} + {{ if not $scheme }} + {{ $link = .link | relLangURL }} + {{ else if in (slice "http" "https") $scheme }} + {{ $target = "target=\"_blank\" rel=\"noopener\"" }} + {{ end }} + + + +{{ end }} -- cgit v1.2.3