mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 19:41:02 +08:00
fix: remove unused back url in the card url
This commit is contained in:
@@ -16,8 +16,6 @@ export const getStaticPaths = (async ({ paginate }) => {
|
|||||||
}) satisfies GetStaticPaths;
|
}) satisfies GetStaticPaths;
|
||||||
|
|
||||||
const { page } = Astro.props;
|
const { page } = Astro.props;
|
||||||
|
|
||||||
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title={`Posts | ${SITE.title}`}>
|
<Layout title={`Posts | ${SITE.title}`}>
|
||||||
@@ -26,7 +24,7 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
|
|||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
page.data.map(({ data, id }) => (
|
page.data.map(({ data, id }) => (
|
||||||
<Card href={`/posts/${id}${backUrl}`} frontmatter={data} />
|
<Card href={`/posts/${id}`} frontmatter={data} />
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ export async function getStaticPaths({ paginate }: GetStaticPathsOptions) {
|
|||||||
const params = Astro.params;
|
const params = Astro.params;
|
||||||
const { tag } = params;
|
const { tag } = params;
|
||||||
const { page, tagName } = Astro.props;
|
const { page, tagName } = Astro.props;
|
||||||
|
|
||||||
const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<Layout title={`Tag: ${tagName} | ${SITE.title}`}>
|
<Layout title={`Tag: ${tagName} | ${SITE.title}`}>
|
||||||
@@ -44,7 +42,7 @@ const backUrl = SITE.showBackButton ? `?from=${Astro.url.pathname}` : "/";
|
|||||||
<ul>
|
<ul>
|
||||||
{
|
{
|
||||||
page.data.map(({ data, id }) => (
|
page.data.map(({ data, id }) => (
|
||||||
<Card href={`/posts/${id}${backUrl}`} frontmatter={data} />
|
<Card href={`/posts/${id}`} frontmatter={data} />
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user