|
1 | 1 | <form class="bd-search d-flex align-items-center">
|
2 | 2 | <input type="search" class="form-control" id="search-input" placeholder="Search..." aria-label="Search for..." autocomplete="off">
|
3 |
| - <button class="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 avigation"> |
| 3 | + <button class="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 | 4 | {% include icons/menu.svg class="" width="30" height="30" %}
|
5 | 5 | </button>
|
6 | 6 | </form>
|
7 | 7 |
|
8 | 8 | <nav class="collapse bd-links" id="bd-docs-nav">
|
9 |
| - {% assign page_slug = page.url | split: '/' | last %} |
10 |
| - {% for group in site.data.nav %} |
11 |
| - {% assign link = group.pages | first %} |
12 |
| - {% assign link_slug = link.title | slugify %} |
13 |
| - {% assign group_slug = group.title | slugify %} |
14 |
| - {% assign active = nil %} |
| 9 | + {%- assign page_slug = page.url | split: '/' | last -%} |
| 10 | + {%- for group in site.data.nav -%} |
| 11 | + {%- assign link = group.pages | first -%} |
| 12 | + {%- assign link_slug = link.title | slugify -%} |
| 13 | + {%- assign group_slug = group.title | slugify -%} |
| 14 | + {%- assign active = nil -%} |
15 | 15 |
|
16 |
| - {% if page.group == group_slug %} |
17 |
| - {% assign active = 'active' %} |
18 |
| - {% endif %} |
| 16 | + {%- if page.group == group_slug -%} |
| 17 | + {%- assign active = 'active' -%} |
| 18 | + {%- endif -%} |
19 | 19 |
|
20 |
| - <div class="bd-toc-item {{ active }}"> |
| 20 | + <div class="bd-toc-item{% unless active == nil %} {{ active }}{% endunless %}"> |
21 | 21 | <a class="bd-toc-link" href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ link_slug }}{% if link_slug %}/{% endif %}">
|
22 | 22 | {{ group.title }}
|
23 | 23 | </a>
|
24 | 24 |
|
25 | 25 | <ul class="nav bd-sidenav">
|
26 |
| - {% for doc in group.pages %} |
27 |
| - {% assign doc_slug = doc.title | slugify %} |
28 |
| - {% assign active = nil %} |
| 26 | + {%- for doc in group.pages -%} |
| 27 | + {%- assign doc_slug = doc.title | slugify -%} |
| 28 | + {%- assign active = nil -%} |
29 | 29 |
|
30 |
| - {% if page.group == group_slug and page_slug == doc_slug %} |
31 |
| - {% assign active = 'active bd-sidenav-active' %} |
32 |
| - {% endif %} |
| 30 | + {%- if page.group == group_slug and page_slug == doc_slug -%} |
| 31 | + {%- assign active = 'active bd-sidenav-active' -%} |
| 32 | + {%- endif -%} |
33 | 33 |
|
34 |
| - <li class="{{ active }}"> |
| 34 | + <li{% unless active == nil %} class="{{ active }}"{% endunless %}> |
35 | 35 | <a href="{{ site.baseurl }}/docs/{{ site.docs_version }}/{{ group_slug }}/{{ doc_slug }}/">
|
36 | 36 | {{ doc.title }}
|
37 | 37 | </a>
|
|
50 | 50 | {% endunless %}
|
51 | 51 | {% endcomment %}
|
52 | 52 | </li>
|
53 |
| - {% endfor %} |
| 53 | + {%- endfor -%} |
54 | 54 | </ul>
|
55 | 55 | </div>
|
56 |
| - {% endfor %} |
| 56 | + {%- endfor -%} |
57 | 57 | </nav>
|
0 commit comments