Skip to content

Commit

Permalink
Fix: slugify tags in post detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
LobbyBoy-Dray authored May 1, 2023
1 parent 4c1b9c8 commit 49d7f77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/layouts/PostDetails.astro
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ import Footer from "@components/Footer.astro";
import Tag from "@components/Tag.astro";
import Datetime from "@components/Datetime";
import type { CollectionEntry } from "astro:content";
import { slugifyStr } from "@utils/slugify";
export interface Props {
post: CollectionEntry<"blog">;
}
const { post } = Astro.props;
const { title, author, description, ogImage, pubDatetime, tags } = post.data;
let { title, author, description, ogImage, pubDatetime, tags } = post.data;
tags = tags.map(tag => slugifyStr(tag));
const { Content } = await post.render();
Expand Down

0 comments on commit 49d7f77

Please sign in to comment.