mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
Create slugify function
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
const slugify = (str: string) =>
|
||||||
|
str
|
||||||
|
.toLowerCase()
|
||||||
|
.replace(/ /g, "-")
|
||||||
|
.replace(/[^\w-]+/g, "");
|
||||||
|
|
||||||
|
export default slugify;
|
||||||
Reference in New Issue
Block a user