From: Danilo M. Date: Fri, 17 Apr 2026 10:03:46 +0000 (+0200) Subject: fix: simplify 404 page to use Hugo's standard i18n without hacks X-Git-Tag: release_22042026-1342~128 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=e66a7d08e8ea7ab6ca14a8dfc7b1b12e8d7b3574;p=danix.xyz-2.git fix: simplify 404 page to use Hugo's standard i18n without hacks Removed JavaScript language detection and Alpine component. Use simple static links that work with both languages. Hugo's redirect rules and i18n system handle language context automatically. No JavaScript hacks. Co-Authored-By: Claude Haiku 4.5 --- diff --git a/themes/danix-xyz-hacker/assets/js/not-found-page.js b/themes/danix-xyz-hacker/assets/js/not-found-page.js index cec60bd..6ec8895 100644 --- a/themes/danix-xyz-hacker/assets/js/not-found-page.js +++ b/themes/danix-xyz-hacker/assets/js/not-found-page.js @@ -31,29 +31,5 @@ document.addEventListener('alpine:init', () => { } })); - Alpine.data('notFoundNav', () => { - const isItalian = window.location.pathname.startsWith('/it/'); - return { - get homeLink() { - return isItalian ? '/it/' : '/'; - }, - get articlesLink() { - return isItalian ? '/it/articles/' : '/articles/'; - }, - get contactLink() { - return isItalian ? '/it/is/here/' : '/is/here/'; - }, - goHome() { - window.location.href = this.homeLink; - }, - goArticles() { - window.location.href = this.articlesLink; - }, - goContact() { - window.location.href = this.contactLink; - } - }; - }); - console.log('notFoundPage Alpine component registered'); }); diff --git a/themes/danix-xyz-hacker/layouts/404.html b/themes/danix-xyz-hacker/layouts/404.html index 341f90b..6ed4892 100644 --- a/themes/danix-xyz-hacker/layouts/404.html +++ b/themes/danix-xyz-hacker/layouts/404.html @@ -1,10 +1,5 @@ {{ define "main" }} - - -