diff --git a/.changeset/friendly-pets-boil.md b/.changeset/friendly-pets-boil.md
new file mode 100644
index 0000000..ab71462
--- /dev/null
+++ b/.changeset/friendly-pets-boil.md
@@ -0,0 +1,5 @@
+---
+"@matthiesenxyz/astro-hashnode": patch
+---
+
+view transition updates
diff --git a/package/src/components/Author.astro b/package/src/components/Author.astro
index 921856c..ee74a3c 100644
--- a/package/src/components/Author.astro
+++ b/package/src/components/Author.astro
@@ -20,16 +20,24 @@ const { post } = Astro.props;
height={50}
class="rounded-3xl mr-3"
loading="eager"
+ transition:animate={"fade"}
+ transition:name={'author:' + post.author.profilePicture}
/>
- {post.author.name}
+ {post.author.name}
.
-
-
{getFormattedDate(post.publishedAt)}
+
+ {getFormattedDate(post.publishedAt)}
.
- {post.readTimeInMinutes} min read
+ {post.readTimeInMinutes} min read
\ No newline at end of file
diff --git a/package/src/components/Header.astro b/package/src/components/Header.astro
index c26e0a5..31b4f67 100644
--- a/package/src/components/Header.astro
+++ b/package/src/components/Header.astro
@@ -7,6 +7,27 @@ const aboutPageData = await getAboutPage();
const baseURL = import.meta.env.BASE_URL;
+const pathname = new URL(Astro.request.url).pathname;
+
+// remove leading and trailing slash
+const removeTrailingAndLeadingSlash = (str:string) => {
+ // define checked string as the original string
+ let checkedStr = str;
+
+ // remove leading slash
+ if (str.startsWith("/")) {
+ checkedStr = str.slice(1);
+ }
+ // remove trailing slash
+ if (str.endsWith("/")) {
+ checkedStr = str.slice(0, -1);
+ }
+ // return checked string
+ return checkedStr;
+}
+
+const currentPath = removeTrailingAndLeadingSlash(pathname);
+
---
diff --git a/package/src/components/PostCard.astro b/package/src/components/PostCard.astro
index c99b358..187c17b 100644
--- a/package/src/components/PostCard.astro
+++ b/package/src/components/PostCard.astro
@@ -26,6 +26,7 @@ const p = await getPost(post.slug);
src={p.coverImage.url}
alt={post.title}
inferSize={true}
+ transition:name={'hero:' + p.coverImage.url}
/>
{post.brief}
diff --git a/package/src/layouts/Layout.astro b/package/src/layouts/Layout.astro
index 48a157f..dd00a18 100644
--- a/package/src/layouts/Layout.astro
+++ b/package/src/layouts/Layout.astro
@@ -62,7 +62,7 @@ const { pageTitle, hideFooter, hideHeader, ogImage } = Astro.props as AstroHashn
- {!hideHeader &&
}
+ {!hideHeader &&
}
diff --git a/package/src/pages/blog/[slug].astro b/package/src/pages/blog/[slug].astro
index 2ee3792..b09a70f 100644
--- a/package/src/pages/blog/[slug].astro
+++ b/package/src/pages/blog/[slug].astro
@@ -28,11 +28,12 @@ const post = await getPost(slug);
alt={post.title}
inferSize={true}
loading="eager"
+ transition:name={'hero:' + post.coverImage.url}
/>
-
{post.title}
+
{post.title}
{post.subtitle}
-
+
{post.tags && post.tags.map((tag) =>
)}
diff --git a/package/src/pages/blog/about.astro b/package/src/pages/blog/about.astro
index 800b93e..6d46f72 100644
--- a/package/src/pages/blog/about.astro
+++ b/package/src/pages/blog/about.astro
@@ -9,7 +9,9 @@ const data = await getAboutPage();
-
{data.title} Page
+
{data.title}
-
{`Welcome to ${pub.displayTitle || pub.title}`}
+
{`Welcome to ${pub.displayTitle || pub.title}`}
diff --git a/package/src/pages/index.astro b/package/src/pages/index.astro
index 408d5b9..827a26a 100644
--- a/package/src/pages/index.astro
+++ b/package/src/pages/index.astro
@@ -13,8 +13,14 @@ import background from "../assets/blog.jpg";
height={1080}
width={1920}
loading="eager"
+ transition:name={'background:' + background}
+ transition:animate={'fade'}
/>
-
+
diff --git a/package/src/pages/ssr-pages/[slug].astro b/package/src/pages/ssr-pages/[slug].astro
index 5f46421..efbb822 100644
--- a/package/src/pages/ssr-pages/[slug].astro
+++ b/package/src/pages/ssr-pages/[slug].astro
@@ -27,6 +27,7 @@ const post = await getPost(checkSlug(slug));
alt={post.title}
inferSize={true}
loading="eager"
+ transition:name={'hero:' + post.coverImage.url}
/>
{post.title}
{post.subtitle}