summaryrefslogtreecommitdiffstats
path: root/themes/danix-xyz-hacker
diff options
context:
space:
mode:
Diffstat (limited to 'themes/danix-xyz-hacker')
-rw-r--r--themes/danix-xyz-hacker/assets/js/not-found-page.js12
-rw-r--r--themes/danix-xyz-hacker/layouts/404.html17
2 files changed, 8 insertions, 21 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 78e3591..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,17 +31,5 @@ document.addEventListener('alpine:init', () => {
}
}));
- Alpine.data('notFoundNav', () => ({
- get homeLink() {
- return window.currentLang === 'it' ? '/it/' : '/';
- },
- get articlesLink() {
- return window.currentLang === 'it' ? '/it/articles/' : '/articles/';
- },
- get contactLink() {
- return window.currentLang === 'it' ? '/it/is/here/' : '/is/here/';
- }
- }));
-
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 0fb6c9a..a81f34d 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,18 @@ window.articlesData = [
</div>
<!-- Navigation Links -->
- <div class="space-y-4 flex flex-col items-center mb-12" x-data="notFoundNav()">
- <a :href="homeLink" class="btn btn-primary">
+ <div class="space-y-4 flex flex-col items-center mb-12">
+ {{ $homeLink := "/" }}
+ {{ if eq .Lang "it" }}
+ {{ $homeLink = "/it/" }}
+ {{ end }}
+ <a href="{{ $homeLink }}" class="btn btn-primary">
{{ i18n "goHome" }}
</a>
- <a :href="articlesLink" class="btn btn-secondary">
+ <a href="{{ if eq .Lang "it" }}/it{{ end }}/articles/" class="btn btn-secondary">
{{ i18n "browseArticles" }}
</a>
- <a :href="contactLink" class="btn btn-outline">
+ <a href="{{ if eq .Lang "it" }}/it{{ end }}/is/here/" class="btn btn-outline">
{{ i18n "contactSupport" }}
</a>
</div>