{%- assign _author = include.author -%}

<div class="author-links">
  <ul class="menu menu--nowrap menu--inline">

    {%- if _author.url -%}
      <link itemprop="url" href="{{ _author.url }}">
    {%- endif -%}

    {%- if _author.type == 'organization' -%}
      {%- include snippets/get-locale-string.html key='EMAIL_US' -%}
      {%- assign _locale_string_email = __return -%}
      {%- include snippets/get-locale-string.html key='FOLLOW_US' -%}
      {%- assign _locale_string_follow = __return -%}
    {%- else -%}
      {%- include snippets/get-locale-string.html key='EMAIL_ME' -%}
      {%- assign _locale_string_email = __return -%}
      {%- include snippets/get-locale-string.html key='FOLLOW_ME' -%}
      {%- assign _locale_string_follow = __return -%}
    {%- endif -%}

    {%- include snippets/get-locale-string.html key='EMAIL_ME' -%}
    {%- if _author.email -%}
      <li title="{{ _locale_string_email }}">
      <a class="button button--circle mail-button" itemprop="email" href="mailto:{{ _author.email }}" target="_blank">
        <div class="icon">{%- include svg/icon/social/mail.svg -%}</div>
      </a>
    {%- endif -%}


    {%- if _author.facebook -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Facebook' }}">
        <a class="button button--circle facebook-button" itemprop="sameAs" href="https://www.facebook.com/{{ _author.facebook }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/facebook.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.twitter -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Twitter' }}">
        <a class="button button--circle twitter-button" itemprop="sameAs" href="https://twitter.com/{{ _author.twitter }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/twitter.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.weibo -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Weibo' }}">
        <a class="button button--circle weibo-button" itemprop="sameAs" href="https://weibo.com/{{ _author.weibo }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/weibo.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.googleplus -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Google+' }}">
        <a class="button button--circle googlepluse-button" itemprop="sameAs" href="https://plus.google.com/u/0/{{ _author.googleplus }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/googleplus.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.telegram -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Telegram' }}">
        <a class="button button--circle telegram-button" itemprop="sameAs" href="https://t.me/{{ _author.telegram }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/telegram.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.medium -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Medium' }}">
        <a class="button button--circle medium-button" itemprop="sameAs" href="https://medium.com/{{ _author.medium }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/medium.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.zhihu -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Zhihu' }}">
        <a class="button button--circle zhihu-button" itemprop="sameAs" href="https://www.zhihu.com/people/{{ _author.zhihu }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/zhihu.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.douban -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Douban' }}">
        <a class="button button--circle douban-button" itemprop="sameAs" href="https://www.douban.com/people/{{ _author.douban }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/douban.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.linkedin -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Linkedin' }}">
        <a class="button button--circle linkedin-button" itemprop="sameAs" href="https://www.linkedin.com/in/{{ _author.linkedin }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/linkedin.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.github -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'Github' }}">
        <a class="button button--circle github-button" itemprop="sameAs" href="https://github.com/{{ _author.github }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/github.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

    {%- if _author.npm -%}
      <li title="{{ _locale_string_follow | replace: '[NAME]', 'npm' }}">
        <a class="button button--circle npm-button" itemprop="sameAs" href="https://www.npmjs.com/~{{ _author.npm }}" target="_blank">
          <div class="icon">{%- include svg/icon/social/npm.svg -%}</div>
        </a>
      </li>
    {%- endif -%}

  </ul>
</div>
