From 82a79a8354a2b9a84dc14e9f50963e313e488cd8 Mon Sep 17 00:00:00 2001 From: Reorx Date: Wed, 1 Jun 2022 16:07:37 +0800 Subject: [PATCH] fix ShowToc true but no toc is generated --- layouts/partials/page_footer.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/layouts/partials/page_footer.html b/layouts/partials/page_footer.html index 24ce455..1ad0e41 100644 --- a/layouts/partials/page_footer.html +++ b/layouts/partials/page_footer.html @@ -60,6 +60,10 @@ if (!enableTocScroll) { return } + if (!document.querySelector('.toc')) { + console.log('no toc found, ignore toc scroll') + return + } // console.log('enable toc scroll') // always get an array here