Skip to content

Commit 61c6ec8

Browse files
committed
fix: remove unused back url in the card url
1 parent 39ed489 commit 61c6ec8

2 files changed

Lines changed: 2 additions & 6 deletions

File tree

src/pages/posts/[...page].astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export const getStaticPaths = (async ({ paginate }) => {
1616
}) satisfies GetStaticPaths;
1717
1818
const { page } = Astro.props;
19-
20-
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
2119
---
2220

2321
<Layout title={`Posts | ${SITE.title}`}>
@@ -26,7 +24,7 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
2624
<ul>
2725
{
2826
page.data.map(({ data, id }) => (
29-
<Card href={`/posts/${id}${backUrl}`} frontmatter={data} />
27+
<Card href={`/posts/${id}`} frontmatter={data} />
3028
))
3129
}
3230
</ul>

src/pages/tags/[tag]/[...page].astro

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ export async function getStaticPaths({ paginate }: GetStaticPathsOptions) {
2929
const params = Astro.params;
3030
const { tag } = params;
3131
const { page, tagName } = Astro.props;
32-
33-
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
3432
---
3533

3634
<Layout title={`Tag: ${tagName} | ${SITE.title}`}>
@@ -44,7 +42,7 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
4442
<ul>
4543
{
4644
page.data.map(({ data, id }) => (
47-
<Card href={`/posts/${id}${backUrl}`} frontmatter={data} />
45+
<Card href={`/posts/${id}`} frontmatter={data} />
4846
))
4947
}
5048
</ul>

0 commit comments

Comments
 (0)