hugo-xmin/layouts/partials/simpletoc.html

19 lines
626 B
HTML
Raw Normal View History

<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>