]> danix's work - danix.xyz-2.git/commitdiff
fix: use language-aware URL construction for 404 navigation links
authorDanilo M. <redacted>
Fri, 17 Apr 2026 09:43:08 +0000 (11:43 +0200)
committerDanilo M. <redacted>
Fri, 17 Apr 2026 09:43:08 +0000 (11:43 +0200)
Updated home, articles, and contact links to properly handle IT/EN language
routing by checking .Lang and building URLs without BaseURL prefix, matching
the pattern used in header.html

Co-Authored-By: Claude Haiku 4.5 <redacted>
themes/danix-xyz-hacker/layouts/404.html

index 00dcfcf4aabac93d2c789f8ab6d6b468aedf1ea3..a81f34d228ba324bb90690cc6d8f11ef0784bac9 100644 (file)
@@ -77,13 +77,17 @@ window.articlesData = [
 
     <!-- Navigation Links -->
     <div class="space-y-4 flex flex-col items-center mb-12">
-      <a href="{{ .Site.BaseURL }}" class="btn btn-primary">
+      {{ $homeLink := "/" }}
+      {{ if eq .Lang "it" }}
+        {{ $homeLink = "/it/" }}
+      {{ end }}
+      <a href="{{ $homeLink }}" class="btn btn-primary">
         {{ i18n "goHome" }}
       </a>
-      <a href="{{ .Site.BaseURL }}{{ .Site.Language.Lang }}/articles/" class="btn btn-secondary">
+      <a href="{{ if eq .Lang "it" }}/it{{ end }}/articles/" class="btn btn-secondary">
         {{ i18n "browseArticles" }}
       </a>
-      <a href="{{ .Site.BaseURL }}{{ .Site.Language.Lang }}/is/here/" class="btn btn-outline">
+      <a href="{{ if eq .Lang "it" }}/it{{ end }}/is/here/" class="btn btn-outline">
         {{ i18n "contactSupport" }}
       </a>
     </div>