hexo-theme-keep/layout/_partial/pjax/pjax.ejs

26 lines
744 B
Plaintext

<%- __js('js/libs/pjax.min.js') %>
<script>
window.addEventListener('DOMContentLoaded', () => {
const pjax = new Pjax({
selectors: [
'head title',
'.page-container',
'.pjax',
],
history: true,
debug: false,
cacheBust: false,
// analytics: false,
// currentUrlFullReload: false,
// scrollRestoration: false,
// scrollTo: true,
// timeout: 0,
});
window.addEventListener('pjax:complete', () => {
KEEP.refresh();
pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
});
});
</script>