aboutsummaryrefslogtreecommitdiffstats
path: root/layouts/partials
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
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')
-rw-r--r--layouts/partials/head.html1
-rw-r--r--layouts/partials/social_links.html22
2 files changed, 23 insertions, 0 deletions
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3a569e7..fce859b 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -7,6 +7,7 @@
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" type="text/css" media="screen" />
{{ end }}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" integrity="sha512-9usAa10IRO0HhonpyAIVpjrylPvoDwiPUiKdWk5t3PyolY1cOd4DSE0Ga+ri4AuTroPR5aQvXU9xC6qOPnzFeg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css">
<link rel="icon" href="/images/favicon.png">
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
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 }}