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:
@@ -8,6 +8,7 @@ import Tag from "@/components/Tag.astro";
|
||||
import { getPostSlug, getPostUrl } from "@/utils/getPostPaths";
|
||||
import { getSortedPosts } from "@/utils/getSortedPosts";
|
||||
import { slugifyStr } from "@/utils/slugify";
|
||||
import { toTransitionName } from "@/utils/toTransitionName";
|
||||
import EditPost from "./_components/EditPost.astro";
|
||||
import ShareLinks from "./_components/ShareLinks.astro";
|
||||
import BackButton from "./_components/BackButton.astro";
|
||||
@@ -111,7 +112,7 @@ const ogImage = ogImageUrl
|
||||
data-pagefind-body
|
||||
>
|
||||
<h1
|
||||
style={{ viewTransitionName: slugifyStr(title.replaceAll(".", "-")) }}
|
||||
style={{ viewTransitionName: toTransitionName(title) }}
|
||||
class="text-accent inline-block text-2xl font-bold sm:text-3xl"
|
||||
>
|
||||
{title}
|
||||
|
||||
Reference in New Issue
Block a user