diff --git a/layout/includes/third-party/pjax.pug b/layout/includes/third-party/pjax.pug index a8094f1..94ec038 100644 --- a/layout/includes/third-party/pjax.pug +++ b/layout/includes/third-party/pjax.pug @@ -59,7 +59,10 @@ script. document.addEventListener('pjax:error', e => { 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 } }) - })() \ No newline at end of file + })()