Merge pull request #1649 from icemyst/patch-1

Update pjax.pug
This commit is contained in:
Jerry Wong
2025-03-02 01:06:20 +08:00
committed by GitHub
Unverified
+4 -1
View File
@@ -59,7 +59,10 @@ script.
document.addEventListener('pjax:error', e => { document.addEventListener('pjax:error', e => {
if (e.request.status === 404) { if (e.request.status === 404) {
window.location.href = e.request.responseURL const usePjax = !{theme.pjax && theme.pjax.enable}
!{theme.error_404 && theme.error_404.enable}
? (usePjax ? pjax.loadUrl('!{url_for("/404.html")}') : window.location.href = '!{url_for("/404.html")}')
: window.location.href = e.request.responseURL
} }
}) })
})() })()