From d43cd7c21be39741ab4173e7ee30dfa2727f381d Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Mon, 10 Sep 2018 15:06:50 -0400 Subject: [PATCH] Improve footer link flexibility Deprecate hardcoded footer links in favor or new `footer.links` array for any link and in any order. All of Font Awesome's icons are available for use. ``` footer: links: - label: "Twitter" icon: "fab fa-fw fa-twitter-square" url: "https://twitter.com/username" - label: "GitHub" icon: "fab fa-fw fa-github" url: "https://github.com/username" - label: "Instagram" icon: "fab fa-fw fa-instagram" url: "https://instagram.com/username" ``` --- _config.yml | 22 ++++++++++++++++++++++ _includes/footer.html | 22 ++++++++-------------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/_config.yml b/_config.yml index 3f2025c..9eeeeeb 100644 --- a/_config.yml +++ b/_config.yml @@ -125,6 +125,28 @@ author: icon: "fab fa-fw fa-instagram" # url: "https://instagram.com/" +# Site Footer +footer: + links: + - label: "Twitter" + icon: "fab fa-fw fa-twitter-square" + # url: + - label: "Facebook" + icon: "fab fa-fw fa-facebook-square" + # url: + - label: "GitHub" + icon: "fab fa-fw fa-github" + # url: + - label: "GitLab" + icon: "fab fa-fw fa-gitlab" + # url: + - label: "Bitbucket" + icon: "fab fa-fw fa-bitbucket" + # url: + - label: "Instagram" + icon: "fab fa-fw fa-instagram" + # url: + # Reading Files include: diff --git a/_includes/footer.html b/_includes/footer.html index 91378ca..b59ff4e 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -3,21 +3,15 @@ {% if site.data.ui-text[site.locale].follow_label %}
  • {{ site.data.ui-text[site.locale].follow_label }}
  • {% endif %} - {% if site.twitter.username %} -
  • Twitter
  • - {% endif %} - {% if site.facebook.username %} -
  • Facebook
  • - {% endif %} - {% if site.author.github %} -
  • GitHub
  • - {% endif %} - {% if site.author.gitlab %} -
  • Gitlab
  • - {% endif %} - {% if site.author.bitbucket %} -
  • Bitbucket
  • + + {% if site.footer.links %} + {% for link in site.footer.links %} + {% if link.label and link.url %} +
  • {{ link.label }}
  • + {% endif %} + {% endfor %} {% endif %} +
  • {{ site.data.ui-text[site.locale].feed_label | default: "Feed" }}
  • -- 2.45.2