feat: update back button logic

Instead of saving back url in the param, save the
back url info inside session.
This commit is contained in:
satnaing
2025-03-06 21:03:31 +07:00
committed by Sat Naing
parent 35429176e0
commit 79c7df45e5
4 changed files with 40 additions and 14 deletions
+1 -7
View File
@@ -29,8 +29,6 @@ const months = [
"November",
"December",
];
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
---
<Layout title={`Archives | ${SITE.title}`}>
@@ -72,10 +70,7 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
)
)
.map(({ data, id }) => (
<Card
href={`/posts/${id}${backUrl}`}
frontmatter={data}
/>
<Card href={`/posts/${id}`} frontmatter={data} />
))}
</ul>
</div>
@@ -84,6 +79,5 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
))
}
</Main>
<Footer />
</Layout>