nav-docs.html 2.47 KB
Newer Older
1
<header class="navbar navbar-static-top bd-sidebar" id="top" role="banner">
Mark Otto's avatar
Mark Otto committed
2
  <a href="{{ site.baseurl }}/" class="navbar-brand">
Mark Otto's avatar
nav    
Mark Otto committed
3
    Bootstrap 4 Alpha
4
  </a>
Mark Otto's avatar
Mark Otto committed
5

Mark Otto's avatar
Mark Otto committed
6
7
8
9
  <button class="navbar-toggler hidden-sm-up" type="button" data-toggle="collapse" data-target="#docsNavbarContent">
    &#9776;
  </button>

10
  <form class="bd-search hidden-sm-down">
Mark Otto's avatar
Mark Otto committed
11
    <input type="text" class="form-control" id="search-input" placeholder="Search...">
12
    <ul class="dropdown-menu bd-search-results" id="search-results"></ul>
Mark Otto's avatar
Mark Otto committed
13
14
  </form>

15
  <nav class="bd-links collapse navbar-toggleable-xs" id="docsNavbarContent">
Mark Otto's avatar
Mark Otto committed
16
17
18
19
20
21
22
23
24
    {% 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 %}

25
      <div class="bd-toc-item {{ active }}">
Mark Otto's avatar
Mark Otto committed
26
27
28
29
30
        {% 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
31
32
33
          {{ group.title }}
        </a>

34
        <ul class="nav bd-sidenav">
Mark Otto's avatar
Mark Otto committed
35
36
37
38
39
          {% for doc in group.pages %}
            {% assign slug = doc.title | downcase | replace: ' ', '-' %}
            {% assign active = nil %}

            {% if page.url contains slug %}
40
              {% assign active = 'active bd-sidenav-active' %}
Mark Otto's avatar
Mark Otto committed
41
42
43
44
45
46
47
            {% endif %}

            <li class="{{ active }}">
              <a href="{{ site.baseurl }}/{{ group.title | downcase | replace: ' ', '-' }}/{{ doc.title | downcase | replace: ' ', '-' }}">
                {{ doc.title }}
              </a>

Mark Otto's avatar
Mark Otto committed
48
              {% comment %}
Mark Otto's avatar
Mark Otto committed
49
50
51
52
53
54
55
56
57
58
59
              {% 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
60
              {% endcomment %}
Mark Otto's avatar
Mark Otto committed
61
62
63
64
65
66
            </li>
          {% endfor %}
        </ul>
      </div>
    {% endfor %}
  </nav>
Mark Otto's avatar
Mark Otto committed
67
</header>