portfolio/lib/createSlug.ts
Ryan Freeman b2c38bddb6
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m43s
New post
2024-10-10 22:32:49 +01:00

5 lines
140 B
TypeScript

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