Cherry.Content.Slug (cherry v0.3.0)

Copy Markdown View Source

Turns titles into URL slugs the same way everywhere: lowercase ASCII-ish, hyphen-separated, nothing else.

Summary

Functions

Slugifies a title.

Functions

slugify(title)

@spec slugify(String.t()) :: String.t()

Slugifies a title.

Examples

iex> Cherry.Content.Slug.slugify("Hello, World! It's Cherry 2.0")
"hello-world-its-cherry-2-0"