jekyll-table-of-contents icon indicating copy to clipboard operation
jekyll-table-of-contents copied to clipboard

How can we show the back-to-top links on second-highest headers as well?

Open 888ba8 opened this issue 4 years ago • 0 comments

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?

888ba8 avatar Dec 29 '20 16:12 888ba8