Routing par hash URL
Démonstration du système de routing d’OntoWave : navigation entre pages via l’ancre URL (#).
Comment fonctionne le routing
OntoWave écoute les changements de hash dans l’URL (window.location.hash) pour charger le fichier Markdown correspondant.
Exemples de routes
index.html#fr/index → charge demos/01-base/index.fr.md
index.html#en/index → charge demos/01-base/index.en.md
index.html#fr/markdown → cette page (en français)
index.html#en/markdown → cette page (en anglais)
Navigation interne
Les liens Markdown relatifs fonctionnent comme des routes :
Format des URLs
Le format d’une route est #<langue>/<chemin> où :
<langue> correspond à un base dans la configuration roots
<chemin> est le chemin relatif au root correspondant
Fallback de langue
Si la langue demandée n’est pas supportée, OntoWave utilise la langue par défaut (i18n.default).
Limite connue
- Les routes sont sensibles à la casse sur les systèmes de fichiers Linux
- Les ancres intra-page (
#titre) ne sont pas distinguées des routes OntoWave
Hash URL Routing
Demonstration of OntoWave’s routing system: page navigation via URL hash (#).
How Routing Works
OntoWave listens to hash changes in the URL (window.location.hash) to load the corresponding Markdown file.
Route Examples
index.html#fr/index → loads demos/01-base/index.fr.md
index.html#en/index → loads demos/01-base/index.en.md
index.html#fr/markdown → this page (in French)
index.html#en/markdown → this page (in English)
Internal Navigation
Relative Markdown links work as routes:
URL Format
A route format is #<lang>/<path> where:
<lang> corresponds to a base in the roots configuration
<path> is the relative path from the corresponding root
Language Fallback
If the requested language is not supported, OntoWave uses the default language (i18n.default).
Known Limitations
- Routes are case-sensitive on Linux file systems
- In-page anchors (
#heading) are not distinguished from OntoWave routes