From 043e92b4d5943c0ece0c4564aedbc14692cb2600 Mon Sep 17 00:00:00 2001 From: Eltrac Date: Thu, 19 Dec 2024 16:27:36 +0800 Subject: perf: set scroll offset for toc --- layouts/partials/scripts.html | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'layouts/partials/scripts.html') 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(); -- cgit v1.2.3