diff --git a/_includes/sidebar.html b/_includes/sidebar.html index c32efb3..c570597 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -64,34 +64,37 @@ {% endunless %} {% 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' -%} + {% case entry.type %} + {% when 'github', 'twitter' %} + {%- capture url -%} + https://{{ entry.type }}.com/{{ site[entry.type].username }} + {%- endcapture -%} + {% when 'email' %} {% assign email = site.social.email | split: '@' %} - javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@') - {%- elsif entry.type == 'rss' -%} - {{ "/feed.xml" | relative_url }} - {%- else -%} - {{ entry.url }} - {%- endif -%} - {% endcapture %} + {%- capture url -%} + javascript:location.href = 'mailto:' + ['{{ email[0] }}','{{ email[1] }}'].join('@') + {%- endcapture -%} + {% when 'rss' %} + {% assign url = '/feed.xml' | relative_url %} + {% else %} + {% assign url = entry.url %} + {% endcase %} {% if url %} + {% unless link_types == empty %}rel="{{ link_types }}"{% endunless %}> + {% endif %}