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
父节点 53baef4d8b
当前提交 a53fb3666f
签署人:: kevin
GPG 密钥 ID: 0342351B3D61AD35
共有 2 个文件被更改,包括 44 次插入2 次删除

查看文件

@ -55,3 +55,37 @@ paginate = 5
type = "PGP" type = "PGP"
value = "pgp_key_file.txt" value = "pgp_key_file.txt"
authn = false 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"

查看文件

@ -1,3 +1,11 @@
<div class="social-box"> <div class="social-box">
<a class="glyph" href="."><i class="fa fa-mastodon"></i></a> {{ 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> </div>