feat: add ViewTransitions from Astro

Integrate ViewTransitions API from Astro v3.

resolve #96
This commit is contained in:
satnaing
2023-09-14 14:00:08 +06:30
committed by Sat Naing
parent e486687610
commit cbdaa59bae
11 changed files with 103 additions and 35 deletions
+22
View File
@@ -0,0 +1,22 @@
---
import Datetime from "@components/Datetime";
import type { BlogFrontmatter } from "@content/_schemas";
export interface Props {
href?: string;
frontmatter: BlogFrontmatter;
secHeading?: boolean;
}
const { href, frontmatter, secHeading = true } = Astro.props;
const { title, pubDatetime, description } = frontmatter;
---
<li class="list-card">
<a href={href} transition:name={title}>
{secHeading ? <h2>{title}</h2> : <h3>{title}</h3>}
</a>
<Datetime datetime={pubDatetime} />
<p>{description}</p>
</li>