diff options
author | Hanzei <16541325+hanzei@users.noreply.github.com> | 2019-01-14 15:35:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 15:35:37 +0300 |
commit | 5bba25cd1667edaa8da42919ab5bdc6e5870ed42 (patch) | |
tree | 173743e769b271d2f7a6b61d68d53f56082f687e | |
parent | 819c0588650c23a85e6d1b10fc1a47c2db72a5ec (diff) | |
parent | 7584ca2c4f30db8fd9d1aa59b11f25efff0fbce8 (diff) |
Add HTML attributes to social links (fixes #121) (#125)
* Insert arbitrary HTML attributes to social links via config.toml
(fixes #121)
-rw-r--r-- | exampleSite/config.toml | 5 | ||||
-rw-r--r-- | layouts/partials/home/social.html | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 08aabc8..8eeb84d 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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 diff --git a/layouts/partials/home/social.html b/layouts/partials/home/social.html index 5750b6f..34a97f1 100644 --- a/layouts/partials/home/social.html +++ b/layouts/partials/home/social.html @@ -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 }} |