ctolkien / Slugify

Simple Slug / Clean URL generator helper for Microsoft .NET framework / .NET Standard.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option for limiting the length of the generated slug

FarshanAhamed opened this issue · comments

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"