Update slugify function with new function slugifyStr

This commit is contained in:
Sat Naing
2022-09-25 19:04:59 +06:30
parent 191798217f
commit bd6fb0ac91
+2 -2
View File
@@ -1,4 +1,4 @@
import slugify from "./slugify";
import { slugifyStr } from "./slugify";
import type { MarkdownInstance } from "astro";
import type { Frontmatter } from "../types";
@@ -7,7 +7,7 @@ const getUniqueTags = (posts: MarkdownInstance<Frontmatter>[]) => {
const filteredPosts = posts.filter(({ frontmatter }) => !frontmatter.draft);
filteredPosts.forEach((post) => {
tags = [...tags, ...post.frontmatter.tags]
.map((tag) => slugify(tag))
.map((tag) => slugifyStr(tag))
.filter(
(value: string, index: number, self: string[]) =>
self.indexOf(value) === index