nav-docs.html 2.21 KB
Newer Older
1
<div class="bd-sidebar">
Mark Otto's avatar
Mark Otto committed
2

3
  <form class="bd-search hidden-sm-down">
Mark Otto's avatar
Mark Otto committed
4
    <input type="text" class="form-control" id="search-input" placeholder="Search...">
5
    <div class="dropdown-menu bd-search-results" id="search-results"></div>
Mark Otto's avatar
Mark Otto committed
6
7
  </form>

8
  <nav class="bd-links" id="docsNavbarContent">
Mark Otto's avatar
Mark Otto committed
9
10
11
12
13
14
15
16
17
    {% for group in site.data.nav %}
      {% assign link = group.pages | first %}
      {% assign slug = group.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' %}
      {% assign active = nil %}

      {% if page.url contains slug %}
        {% assign active = 'active' %}
      {% endif %}

18
      <div class="bd-toc-item {{ active }}">
Mark Otto's avatar
Mark Otto committed
19
20
21
22
23
        {% if slug == "examples" %}
          <a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/">
        {% else %}
          <a class="bd-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ link.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-'  }}">
        {% endif %}
Mark Otto's avatar
Mark Otto committed
24
25
26
          {{ group.title }}
        </a>

27
        <ul class="nav bd-sidenav">
Mark Otto's avatar
Mark Otto committed
28
          {% for doc in group.pages %}
29
            {% assign slug = doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' %}
Mark Otto's avatar
Mark Otto committed
30
31
32
            {% assign active = nil %}

            {% if page.url contains slug %}
33
              {% assign active = 'active bd-sidenav-active' %}
Mark Otto's avatar
Mark Otto committed
34
35
36
            {% endif %}

            <li class="{{ active }}">
37
              <a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' | replace:'-&-','-' }}">
Mark Otto's avatar
Mark Otto committed
38
39
40
                {{ doc.title }}
              </a>

Mark Otto's avatar
Mark Otto committed
41
              {% comment %}
Mark Otto's avatar
Mark Otto committed
42
43
44
45
46
47
48
49
50
51
52
              {% unless doc.sections == nil %}
                <ul class="nav">
                  {% for section in doc.sections %}
                    <li>
                      <a href="#{{ section.title | downcase | replace: ' ', '-' }}">
                        {{ section.title }}
                      </a>
                    </li>
                  {% endfor %}
                </ul>
              {% endunless %}
Mark Otto's avatar
Mark Otto committed
53
              {% endcomment %}
Mark Otto's avatar
Mark Otto committed
54
55
56
57
58
59
            </li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}
  </nav>
60
</div>