From: Danilo M. Date: Fri, 17 Apr 2026 10:18:40 +0000 (+0200) Subject: fix: use language-specific 404 layouts with hardcoded strings X-Git-Tag: release_22042026-1342~127 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=d98d7b2d669368ce8b1cd135742b6a52c7b8f29b;p=danix.xyz-2.git fix: use language-specific 404 layouts with hardcoded strings Created 404.en.html and 404.it.html with fully hardcoded English and Italian text. Hugo automatically routes language-specific requests to the correct layout. No i18n, no hacks, just simple and direct. Co-Authored-By: Claude Haiku 4.5 --- diff --git a/hugo.toml b/hugo.toml index 4913f63..ab6d43e 100644 --- a/hugo.toml +++ b/hugo.toml @@ -127,10 +127,10 @@ enableRobotsTXT = true [[redirects]] from = '/it/**' - to = '/it/404.html' status = 404 + to = '/it/404.html' [[redirects]] # Default language should be last. from = '/**' - to = '/404.html' - status = 404 \ No newline at end of file + status = 404 + to = '/404.html' \ No newline at end of file diff --git a/themes/danix-xyz-hacker/layouts/404.html b/themes/danix-xyz-hacker/layouts/404.en.html similarity index 87% rename from themes/danix-xyz-hacker/layouts/404.html rename to themes/danix-xyz-hacker/layouts/404.en.html index 6ed4892..e1fd8c5 100644 --- a/themes/danix-xyz-hacker/layouts/404.html +++ b/themes/danix-xyz-hacker/layouts/404.en.html @@ -24,21 +24,21 @@ window.articlesData = [

- {{ i18n "notFound" }} + Page Not Found

- {{ i18n "notFoundMessage" }} + Sorry, the page you're looking for doesn't exist. Try searching or browse the articles below.

- + @@ -54,13 +54,13 @@ window.articlesData = [
- {{ i18n "noSearchResults" }} + No articles found matching your search.
-

{{ i18n "recentArticles" }}

+

Recent Articles

{{ range first 5 (where .Site.RegularPages "Section" "articles") }}
@@ -78,13 +78,13 @@ window.articlesData = [ @@ -95,7 +95,7 @@ window.articlesData = [ @click="toggleEasterEgg()" class="text-sm text-text-dim hover:text-accent transition-colors underline" > - {{ i18n "followWhiteRabbit" }} + Follow the white rabbit...
@@ -114,7 +114,7 @@ window.articlesData = [
-

{{ i18n "easterEggTitle" }}

+

Choose Your Path

diff --git a/themes/danix-xyz-hacker/layouts/404.it.html b/themes/danix-xyz-hacker/layouts/404.it.html new file mode 100644 index 0000000..3b4ea2e --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/404.it.html @@ -0,0 +1,151 @@ +{{ define "main" }} + + + + +
+
+
+ +

+ 404 +

+ + +

+ Pagina Non Trovata +

+ +

+ Mi dispiace, la pagina che stai cercando non esiste. Prova a cercare o sfoglia gli articoli qui sotto. +

+ + +
+ + + + +
+ +
+
+ Nessun articolo trovato che corrisponda alla tua ricerca. +
+
+ + +
+

Articoli Recenti

+
+ {{ range first 5 (where .Site.RegularPages "Section" "articles") }} + + {{ end }} +
+
+ + + + + +
+ +
+ + +
+ +
+ + +
+

Scegli il Tuo Percorso

+ +
+ + + +
+ + +
+
+
+
+
+ +{{ end }}