Add HTML attributes to social links

* Insert arbitrary HTML attributes to social links via config.toml

(fixes #121)
This commit is contained in:
Sascha Mann 2019-01-13 22:52:57 +01:00
parent 819c058865
commit 7584ca2c4f
No known key found for this signature in database
GPG key ID: ADA65EEF830F3F0F
2 changed files with 6 additions and 1 deletions

View file

@ -53,6 +53,11 @@ DefaultContentLanguage = "en" # Default language fo
url = "mailto:youremail@email.com" # For a direct email link, use "mailto:test@example.org".
icon = "paper-plane" # icon name without the 'fa-'
icon_pack = "fas"
[[params.social]]
url = "https://mastodon.social/"
icon = "mastodon" # icon name without the 'fa-'
icon_pack = "fab"
html_attributes = "rel=\"me\"" # Add rel attribute for Mastodon profile link verification
# If you don't want to use the default menu, you can define one by yourself

View file

@ -1,6 +1,6 @@
<div class="social-icons">
{{ range .Site.Params.social }}
<a href="{{ .url }}">
<a href="{{ .url }}" {{ .html_attributes | safeHTMLAttr }}>
<i class="{{ .icon_pack}} fa-{{ .icon}}"></i>
</a>
{{ end }}