Helpers for generating consistent, URL-friendly slugs across PhoenixKit.
Provides functions to slugify arbitrary text, enforce separator rules, and ensure uniqueness by delegating existence checks via callback.
Summary
Functions
Ensures the provided slug is unique by calling exists_fun.
Converts the given text into a slug.
Maps lowercase Cyrillic characters to Latin and strips Latin diacritics.
Functions
Ensures the provided slug is unique by calling exists_fun.
exists_fun should return truthy when the slug is already taken.
Converts the given text into a slug.
Options:
:separator- character used between words (defaults to "-"):transliterate- map Cyrillic to Latin and strip Latin diacritics before the ASCII pass (defaults tofalse)
Returns an empty string when the input is blank or cannot be converted.
Maps lowercase Cyrillic characters to Latin and strips Latin diacritics.
Anything outside those scripts is returned unchanged — the caller's slug pass still has to remove it.