Update slug url with new function's slugified url

This commit is contained in:
Sat Naing
2022-09-25 19:07:47 +06:30
parent 013a3299d6
commit 6e79189afd
4 changed files with 11 additions and 7 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import Card from "@components/Card";
import LinkButton from "@components/LinkButton.astro";
import type { MarkdownInstance } from "astro";
import type { Frontmatter } from "src/types";
import slugify from "@utils/slugify";
export interface Props {
pageNum: number;
@@ -28,7 +29,7 @@ const next = pageNum < totalPages ? "" : "disabled";
{
posts.map(({ frontmatter }) => {
return (
<Card href={`/posts/${frontmatter.slug}`} post={frontmatter} />
<Card href={`/posts/${slugify(frontmatter)}`} post={frontmatter} />
);
})
}