portfolio/lib/createSlug.ts
Ryan Freeman 6c0100e9a3
All checks were successful
Build And Publish / BuildAndPublish (push) Successful in 2m39s
Added new page
2024-10-09 21:49:31 +01:00

5 lines
142 B
TypeScript

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