diff --git a/_data/contact.yml b/_data/contact.yml new file mode 100644 index 0000000..a6ec500 --- /dev/null +++ b/_data/contact.yml @@ -0,0 +1,28 @@ +# The contact options. +# v2.3 +# https://github.com/cotes2020/jekyll-theme-chirpy +# © 2020 Cotes Chung +# MIT Licensed + +- + type: github + icon: 'fab fa-github-alt' +- + type: twitter + icon: 'fab fa-twitter' +- + type: email + icon: 'fas fa-envelope' + noblank: true # open link in current tab +- + type: rss + icon: 'fas fa-rss' + noblank: true + +# Complete the url below to enable more contact options +- + icon: 'fab fa-linkedin' # icons powered by + url: '' # Fill with your Linkedin homepage +- + icon: 'fab fa-stack-overflow' + url: '' # Fill with your stackoverflow homepage \ No newline at end of file diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 4101431..6deb037 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -64,18 +64,27 @@ {% endif %} - - - - - - - {% assign email = site.social.email | split: '@' %} - - - - - - + {% for entry in site.data.contact %} + {% capture url %} + {%- if entry.type == 'github' -%} + https://github.com/{{ site.github.username }} + {%- elsif entry.type == 'twitter' -%} + https://twitter.com/{{ site.twitter.username }} + {%- elsif entry.type == 'email' -%} + {% assign email = site.social.email | split: '@' %} + javascript:window.open('mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@')) + {%- elsif entry.type == 'rss' -%} + {{ "/feed.xml" | relative_url }} + {%- else -%} + {{ entry.url }} + {%- endif -%} + {% endcapture %} + + {% if url != '' %} + + + + {% endif %} + {% endfor %} \ No newline at end of file