mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +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 Tag from "@components/Tag.astro";
|
||||||
import Datetime from "@components/Datetime";
|
import Datetime from "@components/Datetime";
|
||||||
import type { CollectionEntry } from "astro:content";
|
import type { CollectionEntry } from "astro:content";
|
||||||
|
import { slugifyStr } from "@utils/slugify";
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
post: CollectionEntry<"blog">;
|
post: CollectionEntry<"blog">;
|
||||||
@@ -12,7 +13,8 @@ export interface Props {
|
|||||||
|
|
||||||
const { post } = Astro.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();
|
const { Content } = await post.render();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user