From fe7c7a4841a58dec4b4957e9c9a32aec5adcade6 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 17 Apr 2026 12:24:04 +0200 Subject: fix: use content-based 404 pages with proper language context Created language-specific 404 content pages (content/en/404.md and content/it/404.md) that Hugo renders with the correct language context. Updated redirect rules and created _default/404.html layout that uses i18n properly. Now .Lang is set correctly for translation strings. Co-Authored-By: Claude Haiku 4.5 --- themes/danix-xyz-hacker/layouts/_default/404.html | 155 ++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 themes/danix-xyz-hacker/layouts/_default/404.html (limited to 'themes/danix-xyz-hacker/layouts/_default/404.html') diff --git a/themes/danix-xyz-hacker/layouts/_default/404.html b/themes/danix-xyz-hacker/layouts/_default/404.html new file mode 100644 index 0000000..4b313cd --- /dev/null +++ b/themes/danix-xyz-hacker/layouts/_default/404.html @@ -0,0 +1,155 @@ +{{ define "main" }} + + + + +
+
+
+ +

+ 404 +

+ + +

+ {{ i18n "notFound" }} +

+ +

+ {{ i18n "notFoundMessage" }} +

+ + +
+
+ + +
+
+ +
+
+ {{ i18n "noSearchResults" }} +
+
+ + +
+

{{ i18n "recentArticles" }}

+
+ {{ range first 5 (where .Site.RegularPages "Section" "articles") }} + + {{ end }} +
+
+ + +
+ {{ $homeLink := "/" }} + {{ if eq .Lang "it" }} + {{ $homeLink = "/it/" }} + {{ end }} + + {{ i18n "goHome" }} + + + {{ i18n "browseArticles" }} + + + {{ i18n "contactSupport" }} + +
+ + +
+ +
+ + +
+ +
+ + +
+

{{ i18n "easterEggTitle" }}

+ +
+ + + +
+ + +
+
+
+
+
+ +{{ end }} -- cgit v1.2.3