summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEltrac <hi@guhub.cn>2024-12-19 16:27:36 +0800
committerEltrac <hi@guhub.cn>2024-12-19 16:27:36 +0800
commit043e92b4d5943c0ece0c4564aedbc14692cb2600 (patch)
treea0a2339ceb7d3245f7a43938100d7ba45222de31
parentb4a540a7989727b7d5ca2691826eab31a1bb3415 (diff)
perf: set scroll offset for toc
-rw-r--r--layouts/partials/scripts.html4
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();