mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: sanitize post title for valid CSS view-transition-name (#650)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
---
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import { getPostUrl } from "@/utils/getPostPaths";
|
||||
import { slugifyStr } from "@/utils/slugify";
|
||||
import { toTransitionName } from "@/utils/toTransitionName";
|
||||
import Datetime from "./Datetime.astro";
|
||||
|
||||
type Props = {
|
||||
@@ -22,7 +22,7 @@ const { title, description, ...props } = data;
|
||||
"focus-visible:no-underline focus-visible:underline-offset-0",
|
||||
]}
|
||||
>
|
||||
<Heading transition:name={slugifyStr(title.replaceAll(".", "-"))}>
|
||||
<Heading transition:name={toTransitionName(title)}>
|
||||
{title}
|
||||
</Heading>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user