PhoenixMultilingual.HTML
(phoenix_multilingual v0.2.0)
Copy Markdown
A collection of functions for generating multilingual HTML elements.
Summary
Functions
Builds a list of data for rel links for the document head.
Functions
Builds a list of data for rel links for the document head.
Example
In the router:
scope "/", MyAppWeb do
get "/about", PageController, :index, metadata("en")
get "/it/chi-siamo", PageController, :index, metadata("it")
endIn the <head> of the layout template:
<%= get_rel_links(@conn) %>Result:
<link rel="canonical" href="https://example.com/about">
<link rel="alternate" hreflang="it" href="https://example.com/it/chi-siamo">