{%- macro icon_link_nav_item(url, icon, name, type) -%}
  {%- if (url | length > 2) and name not in theme_hidden_icons %}
        <li class="nav-item">
          <a class="nav-link" href="{{ url }}" rel="noopener" target="_blank" title="{{ _(name) }}">
            {%- if type == "fontawesome" -%}
            <span><i class="{{ icon }}"></i></span>
            <label class="sr-only">{{ _(name) }}</label>
            {%- elif type == "local" -%}
            <img src="{{ pathto(icon, 1) }}" class="icon-link-image" alt="{{ _(name) }}"/>
            {%- elif type == "url" -%}
            <img src="{{ icon }}" class="icon-link-image" alt="{{ _(name) }}"/>
            {%- else %}
            <span>Incorrectly configured icon link. Type must be `fontawesome`, `url` or `local`.</span>
            {%- endif -%}
          </a>
        </li>
  {%- endif -%}
{%- endmacro -%}

      <ul id="navbar-icon-links" class="navbar-nav" aria-label="{{ _(theme_icon_links_label) }}">
        {%- block icon_link_shortcuts -%}
        {{ icon_link_nav_item(theme_github_url, "fab fa-github-square", "GitHub", "fontawesome") -}}
        {% endblock -%}
        {%- for icon_link in theme_icon_links -%}
        {{ icon_link_nav_item(icon_link["url"], icon_link["icon"], icon_link["name"], icon_link.get("type", "fontawesome")) -}}
        {%- endfor %}
      </ul>
