diff --git a/src/_data/i18n/en/navigation.json b/src/_data/i18n/en/navigation.json index d4f5f3b..f9c1989 100644 --- a/src/_data/i18n/en/navigation.json +++ b/src/_data/i18n/en/navigation.json @@ -1,18 +1,18 @@ [ - { "text": "Solutions", "url": "#solutions" }, - { "text": "Our projects", "url": "#projets" }, - { "text": "DJANGOKAM", "url": "#djangokam" }, - { "text": "Services", "url": "#hebergement" }, - { "text": "Donate", "url": "#dons" }, + { "text": "Solutions", "url": "/en/#solutions" }, + { "text": "Our projects", "url": "/en/#projets" }, + { "text": "DJANGOKAM", "url": "/en/#djangokam" }, + { "text": "Services", "url": "/en/#hebergement" }, + { "text": "Donate", "url": "/en/#dons" }, { "text": "Resources", "children": [ - { "text": "Our work", "url": "#clients" }, - { "text": "Our instances", "url": "#services-libres" }, - { "text": "FAQ", "url": "#faq" }, + { "text": "Our work", "url": "/en/#clients" }, + { "text": "Our instances", "url": "/en/#services-libres" }, + { "text": "FAQ", "url": "/en/#faq" }, { "text": "Press", "url": "/en/press/" }, { "text": "Labola", "url": "https://labola.o-k-i.net/", "external": true } ] }, - { "text": "Contact", "url": "#contact" } + { "text": "Contact", "url": "/en/#contact" } ] diff --git a/src/_data/i18n/fr/navigation.json b/src/_data/i18n/fr/navigation.json index e01e0d6..8362869 100644 --- a/src/_data/i18n/fr/navigation.json +++ b/src/_data/i18n/fr/navigation.json @@ -1,18 +1,18 @@ [ - { "text": "Solutions", "url": "#solutions" }, - { "text": "Nos projets", "url": "#projets" }, - { "text": "DJANGOKAM", "url": "#djangokam" }, - { "text": "Services", "url": "#hebergement" }, - { "text": "Dons", "url": "#dons" }, + { "text": "Solutions", "url": "/#solutions" }, + { "text": "Nos projets", "url": "/#projets" }, + { "text": "DJANGOKAM", "url": "/#djangokam" }, + { "text": "Services", "url": "/#hebergement" }, + { "text": "Dons", "url": "/#dons" }, { "text": "Ressources", "children": [ - { "text": "Réalisations", "url": "#clients" }, - { "text": "Nos instances", "url": "#services-libres" }, - { "text": "FAQ", "url": "#faq" }, + { "text": "Réalisations", "url": "/#clients" }, + { "text": "Nos instances", "url": "/#services-libres" }, + { "text": "FAQ", "url": "/#faq" }, { "text": "Presse", "url": "/presse/" }, { "text": "Labola", "url": "https://labola.o-k-i.net/", "external": true } ] }, - { "text": "Contact", "url": "#contact" } + { "text": "Contact", "url": "/#contact" } ] diff --git a/src/assets/js/main.js b/src/assets/js/main.js index 9175e85..5d276cf 100644 --- a/src/assets/js/main.js +++ b/src/assets/js/main.js @@ -69,12 +69,14 @@ themeToggle?.addEventListener('click', toggleTheme); })(); -// Smooth scrolling -document.querySelectorAll('a[href^="#"]').forEach(anchor => { +// Smooth scrolling (uniquement pour les ancres de la page courante) +document.querySelectorAll('a[href*="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { - e.preventDefault(); - const target = document.querySelector(this.getAttribute('href')); + const url = new URL(this.href, window.location.href); + if (url.pathname !== window.location.pathname || !url.hash) return; + const target = document.querySelector(url.hash); if (target) { + e.preventDefault(); target.scrollIntoView({ behavior: 'smooth', block: 'start'