More Info
Routing
Routing - URL Structure
URL Structure
The URL structure depends on the project mode (static or dynamic).
Dynamic Mode
The URL structure is dynamic and supports pretty URLs, with subpaths for lang, scope, page and id.
Parameters:
~lang— optional language prefix (e.g., ~pt, ~fr), defaults to the system language if omitted.@scope— optional namespace-like scope (e.g., @usa, @bra), used to differentiate context-specific pages.page— identifies the current section or panel (e.g., technologies, trends).id— optional item identifier within a page (e.g., technology/123).
Because several parameters are optional, the implementation uses prefixes (~ for lang, @ for scope) to avoid ambiguity. This allows URLs like:
/technologies→ default language and no scope./@usa/technologies→ scoped to the US./~pt/trends→ Portuguese version./~fr/@bra/technologies→ French version scoped to Brazil./~pt/trends→ Portuguese version./~fr/@bra/technologies→ French version scoped to Brazil.
Data fetching: When fetching data from the API, the parameters can be used to filter the data. This is useful for internationalization and context-specific pages.
Static Mode
In static mode, the URL structure is fixed and routing is handled by search params. Example:
/?lang=pt&scope=usa&page=technologies&id=123