feat(toc): custom enable TOC in each post (#128)

This commit is contained in:
XPoet 2022-09-26 21:07:12 +08:00
parent 1112288bd8
commit b6e04e9153
2 changed files with 3 additions and 2 deletions

View File

@ -59,7 +59,7 @@
<%- partial('_partial/side-tools') %> <%- partial('_partial/side-tools') %>
</div> </div>
<% if (is_post() && theme.toc.enable === true) { %> <% if (is_post() && theme.toc.enable === true && page.toc !== false) { %>
<aside class="page-aside"> <aside class="page-aside">
<%- partial('_partial/toc') %> <%- partial('_partial/toc') %>
</aside> </aside>

View File

@ -94,7 +94,8 @@ function initTOC() {
KEEP.utils.registerSidebarTOC(); KEEP.utils.registerSidebarTOC();
} else { } else {
KEEP.utils.pageContainer_dom.removeChild(document.querySelector('.page-aside')); const pageAsideDom = document.querySelector('.page-aside');
pageAsideDom && KEEP.utils.pageContainer_dom.removeChild(pageAsideDom);
} }
} }