Multilingual.HTML (multilingual v0.1.4)

Summary

Functions

Builds a list of data for rel links for the document head.

Functions

Link to this function

get_rel_links(conn)

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")
end

In 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">