diff --git a/src/components/Tag.astro b/src/components/Tag.astro index cdf8d4c..3c22687 100644 --- a/src/components/Tag.astro +++ b/src/components/Tag.astro @@ -1,4 +1,6 @@ --- +import slugify from "src/utils/slugify"; + export interface Props { name: string; size?: "sm" | "lg"; @@ -6,11 +8,7 @@ export interface Props { const { name, size = "sm" } = Astro.props; -const slug = ((str: string) => - str - .toLowerCase() - .replace(/ /g, "-") - .replace(/[^\w-]+/g, ""))(name); +const slug = slugify(name); ---