Skip to content

Commit 2be1e89

Browse files
johndmulhausenMisty Stanley-Jones
authored andcommitted
Move tab highlighting to Liquid instead of JS
1 parent 544ecfc commit 2be1e89

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

_includes/treebuilder.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{% for section in site.data.toc.horizontalnav %}
22
{% assign topicFound="false" %}
3+
{% assign activeCSS = "" %}
34
{% assign tree = site.data.toc[section.node] %}
45
<!-- path comparison: item.path: {{ item.path }} == page.path: {{ page.url }} -->
56
{% capture thisSection %}{% include tree.html %}{% endcapture %}
67
{% if section.path == page.url or thisSection contains "active currentPage" %}
7-
<span id="currentSection" style="display:none;">{{ section.node }}</span>
8-
{{ thisSection }}
9-
{% break %}
8+
{% capture leftnav %}{{ thisSection }}{% endcapture %}
9+
{% capture activeCSS %} class="active"{% endcapture %}
1010
{% endif %}
11+
<li id="{{ section.node }}"{{ activeCSS }}><a href="{{ section.path }}">{{ section.title }}</a></li>
1112
{% endfor %}

_layouts/docs.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@
193193
<section class="title_section darkblue"> </section>
194194
<div class="col-md-12" style="background-color: #254356">
195195
<!-- tabs -->
196-
<ul class="tabs">{% for section in site.data.toc.horizontalnav %}
197-
<li id="{{ section.node }}"><a href="{{ section.path }}">{{ section.title }}</a></li>{% endfor %}
196+
<ul class="tabs">
197+
{% include treebuilder.html %}
198198
</ul>
199199
</div>
200200
<div class="">
@@ -205,7 +205,7 @@
205205
{% if page.tree == false %}
206206
<li class="leaf"><a href="/">Back to the index</a></li>
207207
{% else %}
208-
{% include treebuilder.html %}
208+
{{ leftnav }}
209209
{% endif %}
210210
</ul>
211211
</div>

js/menu.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
---
2-
layout: null
3-
---
41
var metadata;
52
var autoCompleteShowing = false;
63
var displayingAutcompleteResults = new Array();

0 commit comments

Comments
 (0)