portfolio/lib/createSlug.ts
Ryan Freeman 0100f9a4f6
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m45s
Added new page
2024-10-09 21:37:00 +01:00

5 lines
142 B
TypeScript

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