Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4b05d07

Browse files
Pre-render nav
1 parent 69b3a3d commit 4b05d07

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

_includes/tree.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% for item in tree %}{% if item.heading %}{% else %}{% if item.sectiontitle %}<li class="leaf menu-closed"><a href="/" class="expand-menu "><span class="menu-icon" aria-hidden="true"></span>{{ item.sectiontitle }}</a>
1+
{% for item in tree %}{% if item.heading %}{% else %}{% if item.sectiontitle %}<li class="leaf menu-closed"><a href="#" class="expand-menu "><span class="menu-icon" aria-hidden="true"></span>{{ item.sectiontitle }}</a>
22
<ul class="nav-sub">
33
{% assign tree = item.section %}{% include tree.html %}
44
</ul>

_layouts/docs.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@
187187
<div class="row">
188188
<div class="col-xs-12 col-sm-3 col-md-2 col-xl-2 docsidebarnav_section">
189189
<div class="region region-hero-sub"><ul class="nav-sub">
190-
190+
{% assign tree = site.data.toc.toc %}
191+
{% include tree.html %}
191192
</ul>
192193
</div>
193194
</div>

js/menu.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,15 @@ function hookupTOCEvents()
4141
});
4242
}
4343
jQuery(document).ready(function(){
44+
/*
4445
$.getJSON( "/toc.txt", function( data ) {
4546
tocData = data;
4647
renderTree(data.toc);
4748
$(".nav-sub").html(treeOutput.join(''));
4849
hookupTOCEvents();
4950
});
51+
*/
52+
hookupTOCEvents();
5053
$("#TableOfContents ul").empty();
5154

5255
var prevH2Item = null;

0 commit comments

Comments
 (0)