portfolio/lib/createSlug.ts
r-freeman 1715e0c275
Some checks failed
Build And Publish / BuildAndPublish (push) Failing after 1m50s
Add anchor links to headings
2024-09-18 17:36:21 +01:00

5 lines
138 B
TypeScript

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