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:
@@ -13,7 +13,8 @@ export interface Props {
|
||||
|
||||
const { post } = Astro.props;
|
||||
|
||||
const { title, author, description, ogImage, canonicalURL, pubDatetime, tags } = post.data;
|
||||
const { title, author, description, ogImage, canonicalURL, pubDatetime, tags } =
|
||||
post.data;
|
||||
|
||||
const { Content } = await post.render();
|
||||
|
||||
@@ -21,7 +22,13 @@ const ogUrl = new URL(ogImage ? ogImage : `${title}.png`, Astro.url.origin)
|
||||
.href;
|
||||
---
|
||||
|
||||
<Layout title={title} author={author} description={description} ogImage={ogUrl} canonicalURL={canonicalURL}>
|
||||
<Layout
|
||||
title={title}
|
||||
author={author}
|
||||
description={description}
|
||||
ogImage={ogUrl}
|
||||
canonicalURL={canonicalURL}
|
||||
>
|
||||
<Header />
|
||||
<div class="mx-auto flex w-full max-w-3xl justify-start px-2">
|
||||
<button
|
||||
@@ -36,7 +43,7 @@ const ogUrl = new URL(ogImage ? ogImage : `${title}.png`, Astro.url.origin)
|
||||
</button>
|
||||
</div>
|
||||
<main id="main-content">
|
||||
<h1 class="post-title">{title}</h1>
|
||||
<h1 transition:name={title} class="post-title">{title}</h1>
|
||||
<Datetime datetime={pubDatetime} size="lg" className="my-2" />
|
||||
<article id="article" role="article" class="prose mx-auto mt-8 max-w-3xl">
|
||||
<Content />
|
||||
|
||||
Reference in New Issue
Block a user