aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials/social_links.html
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2023-10-15 23:33:32 +0200
committerOscar Najera <hi@oscarnajera.com>2023-10-15 23:33:32 +0200
commitc23c5f93cde9f98534f2d89e46739a3d35b6239a (patch)
tree692b456488f148b7e1b1f26e9b204947fefad79a /layouts/partials/social_links.html
parent7624fe7007c75a4074b7a257a44cb58f44e03752 (diff)
downloadhugo-minimalist-theme-c23c5f93cde9f98534f2d89e46739a3d35b6239a.tar.gz
hugo-minimalist-theme-c23c5f93cde9f98534f2d89e46739a3d35b6239a.tar.bz2
hugo-minimalist-theme-c23c5f93cde9f98534f2d89e46739a3d35b6239a.zip
Social links
Diffstat (limited to 'layouts/partials/social_links.html')
-rw-r--r--layouts/partials/social_links.html22
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 }}