<!--{# <div class="top-banner fixed-top">
  <div class="d-flex justify-content-center ">
    <span><p class="mb-0">{% trans %}Wave 3 of the XRPL Grants program is open!{% endtrans %}</p></span>
    <span><a href="https://xrplgrants.org/?utm_medium=referral&utm_source=xrpl&utm_campaign=banner" class=" btn btn-outline-secondary" target="_blank">Apply</a></span>
  </div>
</div> #}-->
<nav class="top-nav navbar navbar-expand-lg navbar-dark fixed-top">
  <a href="{% if currentpage.prefix %}{{currentpage.prefix}}{% else %}/{% endif %}" class="navbar-brand"><img class="logo"  height="40" alt="{{target.display_name}}" /></a>
  <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#top-main-nav" aria-controls="navbarHolder" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"><div></div></span>
  </button>
  <div class="collapse navbar-collapse justify-content-between" id="top-main-nav">
    <ul class="nav navbar-nav" id="topnav-pages">
      {% macro dropdown(top_page) %}
      {% set printed_groupings = [] %}
      {% if top_page.children|selectattr('top_nav_omit', 'undefined_or_ne', True)|list|length %}
      <li class="nav-item dropdown">
        <a class="nav-link dropdown-toggle" href="{% if "//" not in top_page.html %}{{currentpage.prefix}}{% endif %}{{top_page.html}}" id="topnav_{{slug(top_page.html)}}" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>{% if top_page.top_nav_name is defined %}{{top_page.top_nav_name}}{% else %}{{top_page.name}}{% endif %}</span></a>
        <div class="dropdown-menu" aria-labelledby="topnav_{{slug(top_page.html)}}" id="topnav_dd_{{slug(top_page.html)}}">
          {% if top_page.top_nav_hero_image is defined %}
          <a class="dropdown-item dropdown-hero" id="dropdown-hero-for-{{slug(top_page.name)}}" href="{% if "//" not in top_page.html %}{{currentpage.prefix}}{% endif %}{{top_page.html}}">
            <img id="{{top_page.top_nav_hero_image}}" alt="{{top_page.name}} icon" />
            <div class="dropdown-hero-text">
              <h4>{{top_page.name}}</h4>
              <p>{{top_page.top_nav_blurb|default(top_page.blurb)}}</p>
            </div>
          </a>
          {% else %}
          <div class="navcol col-for-{{slug(top_page.top_nav_grouping)}}">
            <h5 class="dropdown-item">{{top_page.top_nav_grouping}}</h5>
            {% set _ = printed_groupings.append(top_page.top_nav_grouping) %}
            <a class="dropdown-item {% if currentpage == top_page %} active{% endif %}" href="{% if "//" not in top_page.html %}{{currentpage.prefix}}{% endif %}{{top_page.html}}">{{top_page.name}}</a>
          {% endif %}
          {% set dropdownchildren = top_page.children|list %}
          {% for linkhtml in top_page.top_nav_shortcuts %}
            {% set _ = dropdownchildren.append(pages|selectattr("html", "defined_and_equalto", linkhtml)|first) %}
            {% if _ is not defined %}
              {% include "ERROR: Couldn't find page "+linkhtml+" from top_nav_shortcuts" %}
            {% endif %}
          {% endfor %}
          {% for link in dropdownchildren if not link.top_nav_omit %}
            {% if link.top_nav_grouping not in printed_groupings %}
            {% if printed_groupings %}
          </div><!--./col-->
            {% endif %}
            {% if link.top_nav_grouping is defined %}
          <div class="navcol col-for-{{slug(link.top_nav_grouping)}}">
            <h5 class="dropdown-item">{{link.top_nav_grouping}}</h5>
            {% else %}
          <div class="navcol col-for-ungrouped">
            {% endif %}
            {% set _ = printed_groupings.append(link.top_nav_grouping) %}
            {% endif %}
            <a class="dropdown-item{% if currentpage == link %} active{% endif %}{% if "//" in link.html %} external-link{% endif %}" href="{% if "//" not in link.html %}{{currentpage.prefix}}{% endif %}{{link.html}}"{% if "//" in link.html %} target="_blank"{% endif %}>{% if link.top_nav_name is defined %}{{link.top_nav_name}}{% else %}{{link.name}}{% endif %}</a>
          {% endfor %}
          </div><!--./col-->
        </div><!--/.dropdown-menu-->
      </li>
      {% elif not top_page.top_nav_omit %}
      <li class="nav-item">
        <a class="nav-link{% if "//" in top_page.html %} external-link{% endif %}" href="{% if "//" not in top_page.html %}{{currentpage.prefix}}{% endif %}{{top_page.html}}"{% if "//" in top_page.html %} target="_blank"{% endif %}><span>{{top_page.name}}</span></a>
      </li>
      {% endif %}
      {% endmacro %}

      {% for page in (pages|first).children %}
      {{ dropdown(page) }}
      {% endfor %}
    </ul><!-- /.navbar-nav -->

    <div class="nav-item search" id="topnav-search">
      <form class="navbar-form navbar-right" role="search">
        <div class="form-inline">
          <div class="input-group">
            <label class="input-group-prepend" for="topsearchbox"><i class="fa fa-search input-group-text"></i><span class="sr-only">{% trans %}Search{% endtrans %}</span></label>
            <input id="topsearchbox" name="q" type="text" class="form-control searchinput" placeholder="{% trans %}Search site...{% endtrans %}">
          </div><!--/.input-group-->
        </div>
      </form>
    </div><!--/#topnav-search-->

<!--{#TEMPORARILY DISABLED: language selector (many common pages are mostly untranslated right now)
    <div class="nav-item" id="topnav-language">
      <div class="dropdown">
        <a class="nav-link dropdown-toggle with-caret" id="language_selector_header_btn" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
          {{(config.languages|selectattr('code', 'eq', target.lang)|first).display_name}}
          <span class="chevron"><span></span><span></span></span>
        </a>
        <div class="dropdown-menu smaller-dropdown" aria-labelledby="language_selector_header_btn">
          <hr />
          {% for lang in config.languages if lang.code != target.lang %}
          <a class="dropdown-item" href="{{lang.prefix}}{{currentpage.html}}">
            {{lang.display_name}}
          </a>
          <hr />
          {% endfor %}
        </div><!--/.dropdown-menu-->
      </div><!--/.dropdown-->
    </div><!--/.language-selector-->
#}-->

    {% if target.light_theme_enabled %}
    <div class="nav-item" id="topnav-theme">
      <form class="form-inline">
        <div class="custom-control custom-theme-toggle form-inline-item" title="" data-toggle="tooltip" data-placement="left" data-original-title="Toggle Dark Mode">
          <input type="checkbox" class="custom-control-input" id="css-toggle-btn">
          <label class="custom-control-label" for="css-toggle-btn"><span class="d-lg-none">Light/Dark Theme</span></label>
        </div>
      </form>
    </div><!--/#topnav-theme-->
    {% endif %}
  </div><!--/#top-main-nav-->
</nav>
