summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-04-17 12:03:46 +0200
committerDanilo M. <danix@danix.xyz>2026-04-17 12:03:46 +0200
commite66a7d08e8ea7ab6ca14a8dfc7b1b12e8d7b3574 (patch)
tree7d023345bd50f8e975da8e248a141f9bafb2ff20 /themes/danix-xyz-hacker
parenta3d81d5a1a57a905758b26d9abc1e918eaa39237 (diff)
downloaddanixxyz-e66a7d08e8ea7ab6ca14a8dfc7b1b12e8d7b3574.tar.gz
danixxyz-e66a7d08e8ea7ab6ca14a8dfc7b1b12e8d7b3574.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'themes/danix-xyz-hacker')
-rw-r--r--themes/danix-xyz-hacker/assets/js/not-found-page.js24
-rw-r--r--themes/danix-xyz-hacker/layouts/404.html13
2 files changed, 4 insertions, 33 deletions
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" }}
-<!-- Detect language from current URL -->
-<script>
-window.currentLang = window.location.pathname.startsWith('/it/') ? 'it' : 'en';
-</script>
-
<!-- Pass articles data to JavaScript for Alpine.js -->
<script>
window.articlesData = [
@@ -81,14 +76,14 @@ window.articlesData = [
</div>
<!-- Navigation Links -->
- <div class="space-y-4 flex flex-col items-center mb-12" x-data="notFoundNav()">
- <a :href="homeLink" @click.prevent="goHome()" class="btn btn-primary">
+ <div class="space-y-4 flex flex-col items-center mb-12">
+ <a href="/" class="btn btn-primary">
{{ i18n "goHome" }}
</a>
- <a :href="articlesLink" @click.prevent="goArticles()" class="btn btn-secondary">
+ <a href="/articles/" class="btn btn-secondary">
{{ i18n "browseArticles" }}
</a>
- <a :href="contactLink" @click.prevent="goContact()" class="btn btn-outline">
+ <a href="/is/here/" class="btn btn-outline">
{{ i18n "contactSupport" }}
</a>
</div>