diff --git a/assets/js/papermod.js b/assets/js/papermod.js index a1c990e2..bb2ad2a7 100644 --- a/assets/js/papermod.js +++ b/assets/js/papermod.js @@ -104,7 +104,16 @@ function showCodeCopyButtons() { }); } +function openToc() { + var toc = document.getElementById("toc"); + + if (toc && window.screen.width > 1500 && window.screen.height > 800) { + toc.open = true; + } +} + initializeMenu(); +openToc() if (params.scrollToTop) scrollToTop(); if (params.themeToggle) themeToggle(); if (params.showCodeCopyButtons) showCodeCopyButtons(); \ No newline at end of file diff --git a/layouts/partials/toc.html b/layouts/partials/toc.html index 5965bf8b..1b74034b 100644 --- a/layouts/partials/toc.html +++ b/layouts/partials/toc.html @@ -2,7 +2,7 @@ {{- $has_headers := ge (len $headers) 1 -}} {{- if $has_headers -}}