portfolio/lib/createSlug.ts
Ryan Freeman 18161a50e8
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m46s
New post
2024-10-10 23:02:18 +01:00

5 lines
140 B
TypeScript

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