mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
refactor: replace github-slugger with lodash.kebabcase (#357)
Previously, `github-slugger` omitted emojis when generating slugs, transforming tags like "🌱-my-tag" into "-my-tag". This change replaces `github-slugger` with `lodash.kebabcase` to ensure that emojis are preserved in the generated slugs, improving the accuracy and consistency of tag representations.
This commit is contained in:
committed by
GitHub
parent
65b6a492c3
commit
2b617b20a3
@@ -1,5 +1,5 @@
|
||||
import { slug as slugger } from "github-slugger";
|
||||
import kebabcase from "lodash.kebabcase";
|
||||
|
||||
export const slugifyStr = (str: string) => slugger(str);
|
||||
export const slugifyStr = (str: string) => kebabcase(str);
|
||||
|
||||
export const slugifyAll = (arr: string[]) => arr.map(str => slugifyStr(str));
|
||||
|
||||
Reference in New Issue
Block a user