From a53fb3666f38efaa2a95c4e3a818654880fbd299 Mon Sep 17 00:00:00 2001 From: "Kevin C. Coram" Date: Fri, 6 Dec 2019 23:11:23 -0500 Subject: [PATCH] Configuration driven social network icon links Defines three types of links: email, PGP public key, and profile links. --- exampleSite/config.toml | 34 ++++++++++++++++++++++++++++++++++ layouts/partials/social.html | 12 ++++++++++-- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 4c602ce..2136351 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -55,3 +55,37 @@ paginate = 5 type = "PGP" value = "pgp_key_file.txt" authn = false + + # Configuration parameters for social network links + [[params.Social]] + profile = "MastodonProfileLink" + icon = "fa fa-mastodon" + + [[params.Social]] + profile = "TwitterProfileLink" + icon = "fa fa-twitter" + + [[params.Social]] + profile = "GitHubProfileLink" + icon = "fa fa-github" + + [[params.Social]] + profile = "GitLabProfileLink" + icon = "fa fa-gitlab" + + [[params.Social]] + profile = "GiteaProfileLink" + icon = "fa fa-gitea" + + [[params.Social]] + profile = "FacebookProfileLink" + icon = "fa fa-facebook" + + [[params.Social]] + email = "email@example.com" + icon = "fa fa-envelope-o" + + [[params.Social]] + publicKey = "pgp_key_file.txt" + fingerprint = "AAAA BBBB CCCC DDDD" + icon = "fa fa-key" \ No newline at end of file diff --git a/layouts/partials/social.html b/layouts/partials/social.html index d9889ca..e48c961 100644 --- a/layouts/partials/social.html +++ b/layouts/partials/social.html @@ -1,3 +1,11 @@
- -
+ {{ range .Site.Params.Social }} + {{ if .email }} + + {{ else if .publicKey }} + + {{ else }} + + {{ end }} + {{ end }} + \ No newline at end of file