jekyll-table-of-contents
jekyll-table-of-contents copied to clipboard
How can we show the back-to-top links on second-highest headers as well?
I see the following lines let the back-to-top icon/text/... be shown on the top-level headings only:
var get_level = function(ele) { return parseInt(ele.nodeName.replace("H", ""), 10); };
var highest_level = headers.map(function(_, ele) { return get_level(ele); }).get().sort()[0];
And later this returns:
&& this_level === highest_level
However, how can we expand this such that this applies to the 2 highest levels?