Aller au contenu

Languages, URLs and Parameters

Ekit allows you to build monolingual or multilingual websites without duplicating templates. The displayed language, page and content are automatically determined from the URL.

This document explains the URL model, language handling, and content parameters used by Ekit.


URL structure

From a developer perspective, Ekit pages follow this logical structure:

/[lang]/[view]?param=value
  • lang (optional): language code (en, fr, de, …)
  • view: page name (template)
  • param=value (optional): content parameters (uid, slug, page, …)

Examples

/
/fr/
/en/presentation
/fr/presentation?uid=123
/de/presentation?uid=456

URLs always start with a leading /. This keeps routes explicit, predictable, and aligned with standard web routing conventions.


Language detection

The language is automatically inferred from the first URL segment.

  • If the first segment matches a language configured in the project → it is used
  • Otherwise → the project’s default language is applied

This makes it possible to: - support monolingual projects without extra configuration - share the same templates across multiple languages

Examples

URL Language View
/fr/presentation fr presentation
/de/presentation de presentation
/presentation defaultLang presentation
/ defaultLang index

Unknown language codes

If an unknown language is used:

/it/presentation

Ekit will: - fall back to the default language - ignore the it segment to avoid loading an invalid view


To ensure correct navigation between pages and languages, the main layout should define a base URL.

In layouts/layout.hbs, inside the <head> section:

<base href="{{_base}}">

This guarantees consistent navigation and prevents malformed URLs when mixing relative and root-relative links.


Linking pages and languages

Inside templates, always use root-relative links (starting with /).

Language switcher example

<ul>
  <li><a href="/en/">EN</a></li>
  <li><a href="/fr/">FR</a></li>
  <li><a href="/de/">DE</a></li>
</ul>

Linking to a specific page

<a href="/fr/presentation">Presentation (FR)</a>
<a href="/de/presentation">Presentation (DE)</a>

This URL format is: - explicit - readable - SEO-friendly - aligned with standard web routing conventions


URL parameters

Content-specific data is passed using the query string.

/fr/presentation?uid=abc123

These parameters are exposed to templates via the query object.

Handlebars example

<h1>{{page.title}}</h1>
<p>UID: {{query.uid}}</p>

For pages such as presentations, articles, or product pages, use a single generic view driven by parameters.

Examples:

/fr/presentation?uid=1
/fr/presentation?uid=2
/en/presentation?uid=1

Benefits: - a single view to maintain - no dynamic routing complexity - natural HTTP caching - automatic language handling


Best practices

  • Use the path for navigation (language + view)
  • Use the query string for data (uid, slug, page, …)
  • Keep templates explicit and readable
  • Let HTTP caching handle URL variations

Summary

  • Ekit handles languages automatically
  • Templates are shared across all languages
  • URLs follow the clean /lang/view format
  • Query parameters drive dynamic content
  • The <base> tag guarantees stable navigation

This model keeps projects simple, scalable and easy to maintain.