summaryrefslogtreecommitdiffstats
path: root/hugo.toml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-17 11:54:12 +0200
committerDanilo M. <danix@danix.xyz>2026-04-17 11:54:12 +0200
commita9ae07aea8ab7d9e9b3440bcb90de2ac8163f55e (patch)
treec3a0dde60f6bad8a6272467ab53fd5d9e71072c1 /hugo.toml
parent1ae60588c0ceb8a3ec0b35f4c2cb45a2116ec89a (diff)
downloaddanixxyz-a9ae07aea8ab7d9e9b3440bcb90de2ac8163f55e.tar.gz
danixxyz-a9ae07aea8ab7d9e9b3440bcb90de2ac8163f55e.zip
fix: use client-side language detection with redirect rules for 404 navigation
Rely on hugo.toml redirect rules to serve correct 404.html and detect language from window.location.pathname in notFoundNav() Alpine component. Navigation links now properly route to Italian (/it/*) or English (/*) sections based on request URL. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Diffstat (limited to 'hugo.toml')
-rw-r--r--hugo.toml10
1 files changed, 10 insertions, 0 deletions
diff --git a/hugo.toml b/hugo.toml
index f5019c0..4913f63 100644
--- a/hugo.toml
+++ b/hugo.toml
@@ -124,3 +124,13 @@ enableRobotsTXT = true
label = "Tech"
color_dark = "#a855f7"
color_light = "#7c3aed"
+
+[[redirects]]
+ from = '/it/**'
+ to = '/it/404.html'
+ status = 404
+
+[[redirects]] # Default language should be last.
+ from = '/**'
+ to = '/404.html'
+ status = 404 \ No newline at end of file