#ViewTransition names on images

2 messages · Page 1 of 1 (latest)

wintry anchor
#

I probably have missed something pretty easy, but for the life of me I can not find it.

I started a new blog with the the Blog starter and was trying to integrate ViewTransitions. I added <ViewTransitions /> into the head of my index.astro, and then added
transition:name={featuredPost.slug} to one of my images (currently I am filter out a "featured post" defined in my config.ts.

I now am a bit stuck in my BlogPost.astro layout with:

type Props = CollectionEntry<"blog">["data"];
const { title, description, pubDate, heroImage} = Astro.props;
{
heroImage && (
<img src={heroImage} alt={heroImage} transition:name={""} />
)
}

I know that "slug" does not exist on "data", but I was unsure of where to go from here since it was my understanding that the transition name needed to match.

cursive currentBOT
#
No-one around right now?

It looks like no-one has responded to your question yet. People might not be available right now or don’t know how to answer your question. Want an answer while you wait? Try asking our experimental bot in #1095492539085230272.