mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:01:42 +08:00
Merge pull request #66 from LobbyBoy-Dray/tag-bug-fix
Fix: slugify tags in post detail page
This commit is contained in:
@@ -5,6 +5,7 @@ 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">;
|
||||
@@ -12,7 +13,8 @@ export interface Props {
|
||||
|
||||
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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user