portfolio/lib/createSlug.ts

3 lines
101 B
TypeScript

export function createSlug(title: string) {
return title.toLowerCase().replace(/[.,\s]+/g, '-')
}