diff options
| author | Eltrac <hi@guhub.cn> | 2024-12-19 16:27:36 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2024-12-19 16:27:36 +0800 |
| commit | 043e92b4d5943c0ece0c4564aedbc14692cb2600 (patch) | |
| tree | a0a2339ceb7d3245f7a43938100d7ba45222de31 /layouts | |
| parent | b4a540a7989727b7d5ca2691826eab31a1bb3415 (diff) | |
perf: set scroll offset for toc
Diffstat (limited to 'layouts')
| -rw-r--r-- | layouts/partials/scripts.html | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html index ed791d4c..746134be 100644 --- a/layouts/partials/scripts.html +++ b/layouts/partials/scripts.html @@ -37,12 +37,10 @@ Fancybox.bind("[data-fancybox]"); function loadToc() { tocbot.init({ tocSelector: '#toc', - // Where to grab the headings to build the table of contents. contentSelector: '#post-content', - // Which headings to grab inside of the contentSelector element. headingSelector: 'h2, h3:not(blockquote > h3)', - // For headings inside relative or absolute positioned containers within content. hasInnerContainers: true, + scrollSmoothOffset: -30 }); } loadToc(); |
