🎨 Finish folder structure redesign and add some scripts.

This commit is contained in:
凡梦星尘
2022-06-08 14:51:30 +08:00
parent 168fb20cbb
commit 2973eaf85d
27 changed files with 456 additions and 96 deletions

View File

@@ -38,17 +38,17 @@ NexT.boot.refresh = function() {
* Need to add config option in Front-End at 'scripts/helpers/next-config.js' file.
*/
CONFIG.prism && window.Prism.highlightAll();
CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', {
/*CONFIG.mediumzoom && window.mediumZoom('.post-body :not(a) > img, .post-body > img', {
background: 'var(--content-bg-color)'
});
});*/
CONFIG.lazyload && window.lozad('.post-body img').observe();
CONFIG.pangu && window.pangu.spacingPage();
CONFIG.exturl && NexT.utils.registerExtURL();
NexT.utils.registerCopyCode();
NexT.utils.registerTabsTag();
NexT.utils.registerActiveMenuItem();
NexT.utils.registerLangSelect();
/*NexT.utils.registerActiveMenuItem();
NexT.utils.registerLangSelect();*/
NexT.utils.registerSidebarTOC();
NexT.utils.registerPostReward();
NexT.utils.wrapTableWithBox();

View File

@@ -207,7 +207,7 @@ NexT.utils = {
}, false);
},
registerActiveMenuItem: function() {
/*registerActiveMenuItem: function() {
document.querySelectorAll('.menu-item a[href]').forEach(target => {
const isSamePath = target.pathname === location.pathname || target.pathname === location.pathname.replace('index.html', '');
const isSubPath = !CONFIG.root.startsWith(target.pathname) && location.pathname.startsWith(target.pathname);
@@ -228,7 +228,7 @@ NexT.utils = {
window.location.href = target.dataset.href;
});
});
},
},*/
registerSidebarTOC: function() {
this.sections = [...document.querySelectorAll('.post-toc li a.nav-link')].map(element => {