mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
feat: add ViewTransitions from Astro
Integrate ViewTransitions API from Astro v3. resolve #96
This commit is contained in:
@@ -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>
|
||||
Reference in New Issue
Block a user