portfolio/lib/createSlug.ts
r-freeman 69a288b9b8
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m40s
Add post
2024-09-23 16:17:49 +01:00

5 lines
143 B
TypeScript

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