{% block docs_sidebar %}
{% if theme_navbar_center or theme_navbar_end or sidebars or theme_primary_sidebar_end %}
  {# Header items that will be displayed in the sidebar on mobile #}
  <div class="sidebar-header-items sidebar-primary__section">
    {# The header center items #}
    {% if theme_navbar_center %}
      <div class="sidebar-header-items__center">
        {% for navbar_item in theme_navbar_center %}
          {#
            In the mobile sidebar we do not want a dropdown, so set a large cutoff (999).
          #}
          {% with theme_header_links_before_dropdown=999 %}
            <div class="navbar-item">{% include navbar_item %}</div>
          {% endwith %}
        {% endfor %}
      </div>
    {% endif %}
    {# The header end items #}
    {% if theme_navbar_end %}
      <div class="sidebar-header-items__end">
        {% for navbar_item in theme_navbar_end %}
          <div class="navbar-item">{% include navbar_item %}</div>
        {% endfor %}
      </div>
    {% endif %}
  </div>
  {% if sidebars %}
    <div class="sidebar-primary-items__start sidebar-primary__section">
      {%- for sidebartemplate in sidebars %}
        <div class="sidebar-primary-item">{%- include sidebartemplate %}</div>
      {%- endfor %}
    </div>
  {% endif %}
  {# Items that will snap to the bottom of the screen #}
  <div class="sidebar-primary-items__end sidebar-primary__section">
    {%- for sidebartemplate in theme_primary_sidebar_end %}
      <div class="sidebar-primary-item">{%- include sidebartemplate %}</div>
    {%- endfor %}
  </div>
  {# add the rtd flyout in the sidebar if existing #}
  <div id="rtd-footer-container"></div>
{% endif %}
{% endblock docs_sidebar %}
