docs-sidebar.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <form class="bd-search d-flex align-items-center">
  2. <input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off" data-docs-version="{{ site.docs_version }}">
  3. <button class="btn btn-link bd-search-docs-toggle d-md-none p-0 ml-3" type="button" data-toggle="collapse" data-target="#bd-docs-nav" aria-controls="bd-docs-nav" aria-expanded="false" aria-label="Toggle docs navigation">
  4. {%- include icons/menu.svg width="30" height="30" -%}
  5. </button>
  6. </form>
  7. <nav class="collapse bd-links" id="bd-docs-nav">
  8. {%- assign page_slug = page.url | split: '/' | last -%}
  9. {%- for group in site.data.nav -%}
  10. {%- assign link = group.pages | first -%}
  11. {%- assign link_slug = link.title | slugify -%}
  12. {%- assign group_slug = group.title | slugify -%}
  13. {%- assign active = nil -%}
  14. {%- if page.group == group_slug -%}
  15. {%- assign active = 'active' -%}
  16. {%- endif -%}
  17. <div class="bd-toc-item{% unless active == nil %} {{ active }}{% endunless %}">
  18. <a class="bd-toc-link" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
  19. {{ group.title }}
  20. </a>
  21. <ul class="nav bd-sidenav">
  22. {%- for doc in group.pages -%}
  23. {%- assign doc_slug = doc.title | slugify -%}
  24. {%- assign active = nil -%}
  25. {%- if page.group == group_slug and page_slug == doc_slug -%}
  26. {%- assign active = 'active bd-sidenav-active' -%}
  27. {%- endif -%}
  28. <li{% unless active == nil %} class="{{ active }}"{% endunless %}>
  29. <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ doc_slug }}/">
  30. {{ doc.title }}
  31. </a>
  32. </li>
  33. {%- endfor -%}
  34. </ul>
  35. </div>
  36. {%- endfor -%}
  37. </nav>