Slugify
Slugify copied to clipboard
Option for limiting the length of the generated slug
To make the URL SEO friendly, accepting a length
parameter in Config
or GenerateSlug()
for truncating the string to a limit would be a good addition.
Any suggestions for a good default here?
@ctolkien Better to keep it unlimited by default, I guess.
A oversized slug can be first be murmur hashed, then trimmed to max-length minus 3 characters and appended with the hex number of the first hex-byte of the hash "-xx"