refactor: replace postSlug with Astro content slug

* refactor: replace postSlug with Astro content slug

Remove postSlug from blog schema. Refactor articles that use postSlug. Remove slugify function from slugify util file. Replace slugify logic with Astro's content collections slug logic.

Closes: #186

* docs: update docs for removed slugify contents

* refactor: remove unused import
This commit is contained in:
Sat Naing
2023-12-27 10:20:55 +06:30
committed by GitHub
parent 80e67a1dca
commit 2827d4e7d8
22 changed files with 43 additions and 50 deletions
+1 -2
View File
@@ -4,7 +4,6 @@ import Posts from "@layouts/Posts.astro";
import PostDetails from "@layouts/PostDetails.astro";
import getSortedPosts from "@utils/getSortedPosts";
import getPageNumbers from "@utils/getPageNumbers";
import slugify from "@utils/slugify";
import { SITE } from "@config";
export interface Props {
@@ -15,7 +14,7 @@ export async function getStaticPaths() {
const posts = await getCollection("blog", ({ data }) => !data.draft);
const postResult = posts.map(post => ({
params: { slug: slugify(post.data) },
params: { slug: post.slug },
props: { post },
}));