Add fa icon packs (#113)

This PR adds functionality for users to specify which `icon_pack` to use (`fas` or `fab`; see: https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4) in the `config.toml` file, so that users can use the solid icons as well as the brand icons.

```
    [[params.social]]
        url   = "https://twitter.com/"
        icon  = "twitter" # icon name without the 'fa-'
        icon_pack = "fab"
    [[params.social]]
        url   = "https://facebook.com/"
        icon  = "facebook-f" # icon name without the 'fa-'
        icon_pack = "fab"
    [[params.social]]
        url   = "https://linkedin.com/"
        icon  = "linkedin-in" # icon name without the 'fa-'
        icon_pack = "fab"
    [[params.social]]
        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"
```
This commit is contained in:
Alison Presmanes Hill 2018-12-14 00:32:50 -08:00 committed by Hanzei
parent 3a6144e557
commit 2c5cfbc4b3
5 changed files with 20 additions and 11 deletions

4
docs/de/index.html generated

File diff suppressed because one or more lines are too long

4
docs/es/index.html generated

File diff suppressed because one or more lines are too long

4
docs/index.html generated

File diff suppressed because one or more lines are too long

View file

@ -34,16 +34,25 @@ DefaultContentLanguage = "en" # Default language fo
pinterest = true
# Social icons appear in introduction and contact section. Add as many more as you like.
# Find icon names here: https://fontawesome.com/cheatsheet/
# Icon pack "fab" includes social network icons, see: https://fontawesome.com/icons?d=gallery&s=brands&m=free
# Icon pack "fas" includes solid style icons, see: https://fontawesome.com/icons?d=gallery&s=solid&m=free
[[params.social]]
url = "https://twitter.com/"
icon = "twitter"
icon = "twitter" # icon name without the 'fa-'
icon_pack = "fab"
[[params.social]]
url = "https://facebook.com/"
icon = "facebook-f"
icon = "facebook-f" # icon name without the 'fa-'
icon_pack = "fab"
[[params.social]]
url = "https://linkedin.com/"
icon = "linkedin-in"
icon = "linkedin-in" # icon name without the 'fa-'
icon_pack = "fab"
[[params.social]]
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"
# If you don't want to use the default menu, you can define one by yourself
# [[menu.main]]

View file

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