mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 07:33:07 +08:00
Update slugify function with new function slugifyStr
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user