<div id="navbar"
  class="{{ theme_navbar_class }} navbar-default {% if theme_navbar_fixed_top|tobool -%} navbar-fixed-top{%- endif -%}">
  <div class="container">
    <div class="navbar-header">
      <!-- Brand and toggle get grouped for better mobile display -->
      <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{{ theme_logo_url }}">
        {%- block sidebarlogo %}
        {%- if logo %}<span><img src="{{ pathto('_static/' + logo, 1) }}"></span>{%- endif %}
        {%- endblock %}
        {% if theme_navbar_title -%}{{ theme_navbar_title|e }}{%- else -%}{{ project|e }}{%- endif -%}
      </a>
    </div>

    <div class="collapse navbar-collapse nav-collapse">
      <ul class="nav navbar-nav navbar-left">
        {% if theme_navbar_links %}
        {%- for navlink in theme_navbar_links %}
        {% if navlink[1] is not string %}
        <li class="dropdown">
          <a role="button" data-toggle="dropdown" data-target="" href="">{{ navlink[0] }}<b class="caret"></b></a>
          <ul class="dropdown-menu">
            {%- for link in navlink[1] %}
            <li class="dropdown-submenu">
              <a href="{{ pathto(*link[1:]) }}">{{ link[0] }}</a>
            </li>
            {%- endfor %}
          </ul>
        </li>
        {% else %}
        <li><a href="{{ pathto(*navlink[1:]) }}">{{ navlink[0] }}</a></li>
        {% endif %}
        {%- endfor %}
        {% endif %}
      </ul>
    </div>
  </div>
</div>
