<nav class="navbar navbar-expand-lg navbar-light bg-primary">
  <div class="container">
    <a class="navbar-brand" href="/">
      <picture>
        <source srcset="/assets/img/layout/privacy-guides-logo-dark.svg" media="(prefers-color-scheme: dark)">
        <img src="/assets/img/layout/privacy-guides-logo.svg" alt="Privacy Guides Logo" width="300" height="39">
      </picture>
    </a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <div class="ms-auto"></div>
      <ul class="navbar-nav mt-2 mt-lg-0">
        {% for item_hash in site.data.nav %}
        {% assign item = item_hash[1] %}
        {% if item.type == "link" %}
        <li class="nav-item">
          <a class="nav-link" href="{% link {{ item.file }} %}">{{ item.title }}</a>
        </li>
        {% elsif item.type == "dropdown" %}
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="providerDropdown" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            {{ item.title }}
          </a>
          <div class="dropdown-menu" aria-labelledby="navbarDropdown">
            {% for subitem in item.items %}
            {% if subitem.type == "link" %}
            <a class="dropdown-item" href="{% link {{ subitem.file }} %}{%- if subitem.anchor -%}#{{ subitem.anchor }}{%- endif -%}"><span class="{{ subitem.icon | default: "fad fa-file" }} fa-fw"></span> {{ subitem.title }}</a>
            {% elsif subitem.type == "divider" %}
            <div class="dropdown-divider"></div>
            {% endif %}
            {% endfor %}
          </div>
        </li>
        {% endif %}
        {% endfor %}
      </ul>
    </div>
  </div>
</nav>
