Remove InstantClick

This commit is contained in:
nanxiaobei 2019-08-20 04:13:23 +08:00
parent 68a57bbb47
commit 2f3e41736d
1 changed files with 2 additions and 25 deletions

View File

@ -6,30 +6,7 @@
<span>&middot;</span> <span>&middot;</span>
<span>Theme <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span> <span>Theme <a href="https://github.com/nanxiaobei/hugo-paper" rel="noopener" target="_blank">Paper</a></span>
</footer> </footer>
<script src="{{ "js/instantclick.min.js" | absURL }}" data-no-instant></script> <script src="{{ "highlight.min.js" | absURL }}"></script>
<script data-no-instant>InstantClick.init();</script> <script>hljs.initHighlightingOnLoad();</script>
<script src="{{ "js/highlight.min.js" | absURL }}" data-no-instant></script>
<script data-no-instant>
let body;
function menuToggleListener() {
body.classList.toggle('blur');
}
function setMenuToggleListener() {
const menuToggle = document.querySelector('.menu-toggle');
if (!menuToggle) return;
body = document.querySelector('body');
menuToggle.addEventListener('click', menuToggleListener);
}
hljs.initHighlightingOnLoad();
setMenuToggleListener();
InstantClick.on('change', function () {
document.querySelectorAll('pre code').forEach((block) => {
hljs.highlightBlock(block);
});
setMenuToggleListener();
});
</script>
</body> </body>
</html> </html>