TOC display and highlight current document in left nav (#95)

* toc CSS and JS fixes

* highlight current doc in left nav
This commit is contained in:
Dave 2017-05-02 17:25:05 -04:00 committed by Shriram Rajagopalan
parent f447eec8cb
commit 55a037737b
1 changed files with 6 additions and 1 deletions

View File

@ -75,7 +75,12 @@ function outputNavBarTree(items) {
var item = items[i];
if (item.children.length == 0) {
document.write("<li class='doc-side-nav-list-item'><a href='");
if (item.doc.url == location.pathname) {
document.write("<li class='doc-side-nav-list-item'><a class='current' href='");
}
else {
document.write("<li class='doc-side-nav-list-item'><a href='");
}
document.write("{{home}}");
document.write(item.doc.url);
document.write("'>");