hugo-xmin/layouts/partials/simpletoc.html

19 lines
No EOL
626 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script src="/js/simpletoc.js"></script>
<script>
var firstLvl = 2; // h2 start
var lastLvl = 4; // h4 end
var divID = "TOC";
var divToSearch = "post-content";
window.onload=function(){
//params
// param1firstleveldefault: h2
// param2lastLeveldefualt: h3
// param3divID, the div to place the tocdefault: TOC
// param4the wrapper div containing headlines to search
toc(firstLvl, lastLvl, divID, divToSearch);
diyStyle(divID);
addNewStyle('@media (max-width: 48em) {#'+divID+'{display: none;} }');
addNewStyle('.TOCSectNum {margin-right: 0.5em;}');
}
</script>
<div id="TOC"></div>