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/_default/about.html | 17 +++++++++++++++-- layouts/partials/head.html | 1 + layouts/partials/social_links.html | 22 ++++++++++++++++++++++ 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 layouts/partials/social_links.html diff --git a/layouts/_default/about.html b/layouts/_default/about.html index 9c4ca2f..4a3a656 100644 --- a/layouts/_default/about.html +++ b/layouts/_default/about.html @@ -1,9 +1,22 @@ {{ define "hero" }} - {{ partial "hero.html" . }} +
+
+ +

{{ .Site.Author.name }}

+

{{ .Site.Author.role }}

+
+ {{ partial "social_links" . }} +
+
+
{{ end }} {{ define "main" }} -
{{ range .Paginator.Pages }}
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 @@ {{ end }} + {{ range .AlternativeOutputFormats -}} {{ printf `` .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 }} + + + +{{ end }} -- cgit v1.2.3