slugify helper: handle trailing slashes