diff options
Diffstat (limited to 'layouts/partials/social_links.html')
-rw-r--r-- | layouts/partials/social_links.html | 22 |
1 files changed, 22 insertions, 0 deletions
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 }} + <a + href="{{ $link | safeURL }}" + {{ $target | safeHTMLAttr }} + class="link near-white" + > + <i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }} h2"></i> + </a> +{{ end }} |