diff --git a/_includes/toc_pure_liquid.html b/_includes/toc_pure_liquid.html index 84bd122d9c..cd1a2ed60a 100644 --- a/_includes/toc_pure_liquid.html +++ b/_includes/toc_pure_liquid.html @@ -2,7 +2,7 @@ {% comment %} "...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe Usage: - {% include toc_pure_liquid.html html=content sanitize=true class="inline_toc" id="my_toc" toc_min=2 toc_max=3 my_name="unnamed" %} + {% include toc_pure_liquid.html html=content sanitize=true class="inline_toc" id="my_toc" toc_min=2 toc_max=3 %} Variables: * html (string) - the HTML of compiled markdown generated by kramdown in Jekyll @@ -11,7 +11,6 @@ * id (string) - an ID to assigned to the TOC * toc_min (int) - the minimum TOC header level to use (if not set, check page, then site, then default to 2) * toc_max (int) - the maximum TOC header level to use (if not set, check page, then site, then default to 3) - * page_name (string) - the URL of the page Output: An unordered list representing the table of contents of a markdown block. This snippet will only generate the table of contents and will NOT output the markdown given to it @@ -20,7 +19,6 @@ {% capture my_toc %}{% endcapture %} {% assign minHeader = include.toc_min | default: 2 %} {% assign maxHeader = include.toc_max | default: 3 %} - {% assign my_name = include.page_name | default: "unnamed" %} {% assign nodes = include.html | split: ' 200) ? 200 : headerOffset - 20; - $("#sidebar-wrapper").animate({ - scrollTop: $("#sidebar-wrapper").scrollTop() + $(this).position().top - sidebarOffset - },100); - //document.getElementById("sidebar-wrapper").scrollTop = this.getBoundingClientRect().top - 200; - } else { - $(this).removeClass("active"); - } - }); - } + if (document.location.pathname.indexOf("/glossary/") < 0){ + $("#my_toc a.active").removeClass("active"); + + if (heading !== "title") { + $("#my_toc a[href='#" + heading + "']").addClass('active'); } } } + var currentHeading = ""; $(window).scroll(function(){ var headingPositions = new Array();