pub fn slugify(name: &str) -> StringExpand description
Normalize a page name into a slug.
Rules:
- Lowercase
- Trim whitespace
- Split on
/and normalize each segment independently - Within each segment: replace spaces and underscores with hyphens, strip punctuation, collapse consecutive hyphens, trim leading/trailing hyphens
- Preserve Unicode alphanumeric characters
- Drop empty segments (handles
//, leading/, trailing/) - Rejoin with
/