portfolio/lib/createSlug.ts
r-freeman 377349ae44
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m43s
Update createSlug function
2024-09-23 15:59:44 +01:00

6 lines
166 B
TypeScript

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