Configuration driven social network icon links

Defines three types of links: email, PGP public key, and profile links.
master
Kevin C. Coram 2019-12-06 23:11:23 -05:00
parent 53baef4d8b
commit a53fb3666f
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
2 changed files with 44 additions and 2 deletions

View File

@ -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"

View File

@ -1,3 +1,11 @@
<div class="social-box">
<a class="glyph" href="."><i class="fa fa-mastodon"></i></a>
</div>
{{ range .Site.Params.Social }}
{{ if .email }}
<a class="glyph u-email" href="mailto:{{ .email }}" rel="me"><i class="{{ .icon }}"></i></a>
{{ else if .publicKey }}
<a class="glyph p-pgp" href="{{ .publicKey }}" rel="pgpkey" title="{{ .fingerprint }}"><i class="{{ .icon }}"></i></a>
{{ else }}
<a class="glyph" href="{{ .profile }}" rel="me"><i class="{{ .icon }}"></i></a>
{{ end }}
{{ end }}
</div>