{% if page.author %}
  {% assign author = site.data.authors[page.author] %}{% else %}{% assign author = site.author %}
{% endif %}

<div itemscope itemtype="http://schema.org/Person">

  <div class="author__avatar">
    {% if author.avatar contains "http" %}
    	<img src="{{ author.avatar }}" alt="{{ author.name }}">
    {% else %}
    	<img src="{{ author.avatar | prepend: "/images/" | prepend: base_path }}" class="author__avatar" alt="{{ author.name }}">
    {% endif %}
  </div>

  <div class="author__content">
    <h3 class="author__name">{{ author.name }}</h3>

    {% if author.bio %}<p class="author__bio">{{ author.bio }}</p>{% endif %}

    <div class="author__urls">
      {% if author.uri %}
        <a href="{{ author.uri }}" target="_blank"><i class="fa fa-fw fa-globe"></i>Website</a>
      {% endif %}
      {% if author.email %}
        <a href="mailto:{{ author.email }}" target="_blank"><i class="fa fa-fw fa-envelope-square"></i> Email</a>
      {% endif %}
      {% if author.twitter %}
        <a href="http://twitter.com/{{ author.twitter }}" target="_blank"><i class="fa fa-fw fa-twitter-square"></i> Twitter</a>
      {% endif %}
      {% if author.facebook %}
        <a href="http://facebook.com/{{ author.facebook }}" target="_blank"><i class="fa fa-fw fa-facebook-square"></i> Facebook</a>
      {% endif %}
      {% if author.google_plus %}
        <a href="http://plus.google.com/+{{ author.google_plus }}" target="_blank"><i class="fa fa-fw fa-google-plus-square"></i> Google+</a>
      {% endif %}
      {% if author.linkedin %}
        <a href="http://linkedin.com/in/{{ author.linkedin }}" target="_blank"><i class="fa fa-fw fa-linkedin-square"></i> LinkedIn</a>
      {% endif %}
      {% if author.xing %}
        <a href="http://www.xing.com/profile/{{ author.xing }}" target="_blank"><i class="fa fa-fw fa-xing-square"></i> XING</a>
      {% endif %}
      {% if author.instagram %}
        <a href="http://instagram.com/{{ author.instagram }}" target="_blank"><i class="fa fa-fw fa-instagram"></i> Instagram</a>
      {% endif %}
      {% if author.tumblr %}
        <a href="http://{{ author.tumblr }}.tumblr.com" target="_blank"><i class="fa fa-fw fa-tumblr-square"></i> Tumblr</a>
      {% endif %}
      {% if author.github %}
        <a href="http://github.com/{{ author.github }}" target="_blank"><i class="fa fa-fw fa-github"></i> Github</a>
      {% endif %}
      {% if author.stackoverflow %}
        <a href="http://stackoverflow.com/users/{{ author.stackoverflow }}" target="_blank"><i class="fa fa-fw fa-stack-overflow"></i> Stackoverflow</a>
      {% endif %}
      {% if author.lastfm %}
        <a href="http://lastfm.com/user/{{ author.lastfm }}" target="_blank"><i class="fa fa-fw fa-music"></i> Last.fm</a>
      {% endif %}
      {% if author.dribbble %}
        <a href="http://dribbble.com/{{ author.dribbble }}" target="_blank"><i class="fa fa-fw fa-dribbble"></i> Dribbble</a>
      {% endif %}
      {% if author.pinterest %}
        <a href="http://www.pinterest.com/{{ author.pinterest }}" target="_blank"><i class="fa fa-fw fa-pinterest"></i> Pinterest</a>
      {% endif %}
      {% if author.foursquare %}
        <a href="http://foursquare.com/{{ author.foursquare }}" target="_blank"><i class="fa fa-fw fa-foursquare"></i> Foursquare</a>
      {% endif %}
      {% if author.steam %}
        <a href="http://steamcommunity.com/id/{{ author.steam }}" target="_blank"><i class="fa fa-fw fa-steam-square"></i> Steam</a>
      {% endif %}
      {% if author.youtube %}
        <a href="https://youtube.com/user/{{ author.youtube }}" target="_blank"><i class="fa fa-fw fa-youtube-square"></i> Youtube</a>
      {% endif %}
      {% if author.soundcloud %}
        <a href="http://soundcloud.com/{{ author.soundcloud }}" target="_blank"><i class="fa fa-fw fa-soundcloud"></i> Soundcloud</a>
      {% endif %}
      {% if author.weibo %}
        <a href="http://www.weibo.com/{{ author.weibo }}" target="_blank"><i class="fa fa-fw fa-weibo"></i> Weibo</a>
      {% endif %}
      {% if author.flickr %}
        <a href="http://www.flickr.com/{{ author.flickr }}" target="_blank"><i class="fa fa-fw fa-flickr"></i> Flickr</a>
      {% endif %}
      {% if author.codepen %}
        <a href="http://codepen.io/{{ author.codepen }}" target="_blank"><i class="fa fa-fw fa-codepen"></i> CodePen</a>
      {% endif %}
    </div>
  </div>
</div>
