diff --git a/layout/page.ejs b/layout/page.ejs index 5fe3e64..f0d8142 100644 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -59,7 +59,7 @@ <%- partial('_partial/side-tools') %> - <% if (is_post() && theme.toc.enable === true) { %> + <% if (is_post() && theme.toc.enable === true && page.toc !== false) { %> diff --git a/source/js/toc.js b/source/js/toc.js index ceef590..b2190bc 100644 --- a/source/js/toc.js +++ b/source/js/toc.js @@ -94,7 +94,8 @@ function initTOC() { KEEP.utils.registerSidebarTOC(); } else { - KEEP.utils.pageContainer_dom.removeChild(document.querySelector('.page-aside')); + const pageAsideDom = document.querySelector('.page-aside'); + pageAsideDom && KEEP.utils.pageContainer_dom.removeChild(pageAsideDom); } }