portfolio/lib/createSlug.ts
2024-09-23 20:39:55 +01:00

5 lines
141 B
TypeScript

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