function slugify
slugify(
title: string,
max?: number
): string

Turns title into lowercase ASCII words joined by hyphens, at most max characters long, cut at a hyphen when it must be cut. Accents are dropped, and a title with no ASCII letter or digit gives untitled. The result always passes isValidSlug.

Parameters

title: string
optional
max: number = SLUG_MAX

Return Type

string

Usage

import { slugify } from "shared/slug.ts";