7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-12-26 22:00:21 +00:00
web-ansol.org/themes/academic/layouts/partials/social_links.html

23 lines
711 B
HTML
Raw Normal View History

2020-06-11 11:46:16 +00:00
<ul class="network-icon" aria-hidden="true">
{{ 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 }}
<li>
<a href="{{ $link | safeURL }}" {{ $target | safeHTMLAttr }}>
<i class="{{ $pack }} {{ $pack_prefix }}-{{ .icon }}"></i>
</a>
</li>
{{end}}
</ul>