DatoCMS client v0.2.4 Slug View Source
Link to this section Summary
Functions
Returns a slug, combining id and title
Link to this section Functions
Link to this function
for(id, title) View Source
Returns a slug, combining id and title.
Example
iex> Slug.for(123, "ciao")
"123-ciao"
Normalization
The title is downcased:
iex> Slug.for(123, "AAAAA")
"123-aaaaa"
Non-Latin characters are transliterated:
iex> Slug.for(123, "andò")
"123-ando"
Separator characters are converted to '-':
iex> Slug.for(123, "R&R")
"123-r-r"
Leading '-' is removed:
iex> Slug.for(123, "-1")
"123-1"
Trailing '-' is removed:
iex> Slug.for(123, "1-")
"123-1"