docs-nav.html 1.83 KB
Newer Older
Mark Otto's avatar
Mark Otto committed
1
<header class="navbar navbar-static-top bs-docs-sidebar" id="top" role="banner">
Mark Otto's avatar
Mark Otto committed
2
  <a href="{{ site.baseurl }}/" class="navbar-brand">
3
4
5
6
7
8
    Bootstrap
  </a>
  {% for group in site.data.nav %}
    {% assign link = group.pages | first %}
    {% assign slug = group.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-' %}
    {% assign active = nil %}
Mark Otto's avatar
Mark Otto committed
9

10
11
12
    {% if page.url contains slug %}
      {% assign active = 'active' %}
    {% endif %}
Mark Otto's avatar
Mark Otto committed
13

14
    <div class="bs-docs-toc-item {{ active }}">
Mark Otto's avatar
Mark Otto committed
15
      <a class="bs-docs-toc-link" href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ link.title | downcase | replace: ' ', '-' || page.title | downcase | replace: ' ', '-'  }}">
16
17
        {{ group.title }}
      </a>
Mark Otto's avatar
Mark Otto committed
18

19
20
21
22
      <ul class="nav bs-docs-sidenav">
        {% for doc in group.pages %}
          {% assign slug = doc.title | downcase | replace: ' ', '-' %}
          {% assign active = nil %}
Mark Otto's avatar
Mark Otto committed
23

24
25
26
          {% if page.url contains slug %}
            {% assign active = 'active' %}
          {% endif %}
Mark Otto's avatar
Mark Otto committed
27

28
          <li class="{{ active }}">
Mark Otto's avatar
Mark Otto committed
29
            <a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' }}">
30
31
              {{ doc.title }}
            </a>
Mark Otto's avatar
Mark Otto committed
32

33
34
35
36
            {% unless doc.sections == nil %}
              <ul class="nav">
                {% for section in doc.sections %}
                  <li>
Mark Otto's avatar
Mark Otto committed
37
                    <a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' }}/#{{ section.title | downcase | replace: ' ', '-' }}">
38
39
40
41
42
43
44
45
46
47
48
                      {{ section.title }}
                    </a>
                  </li>
                {% endfor %}
              </ul>
            {% endunless %}
          </li>
        {% endfor %}
      </ul>
    </div>
  {% endfor %}
Mark Otto's avatar
Mark Otto committed
49
</header>