Skip to content

Commit 1ba87c0

Browse files
committed
fix: pagination component url errors
1 parent 2b118ce commit 1ba87c0

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/components/blog/Pagination.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ const paginationList = Array.from({length}, (_, i) => i + 1);
55
---
66
<nav aria-label="Blog pages" class="pagination">
77
{firstUrl ? (
8-
<a href={`/developers${firstUrl}`} class="pagination__link">&#171;</a>
8+
<a href={`${firstUrl}`} class="pagination__link">&#171;</a>
99
) : (
1010
<span class="pagination__link disabled">&#171;</span>
1111
)}
1212

1313
{prevUrl ? (
14-
<a href={`/developers${prevUrl}`} class="pagination__link">&#8249;</a>
14+
<a href={`${prevUrl}`} class="pagination__link">&#8249;</a>
1515
) : (
1616
<span class="pagination__link disabled">&#8249;</span>
1717
)}
@@ -28,11 +28,11 @@ const paginationList = Array.from({length}, (_, i) => i + 1);
2828
{!nextUrl ? (
2929
<span class="pagination__link disabled">&#8250;</span>
3030
) : (
31-
<a href={`/developers${nextUrl}`} class="pagination__link">&#8250;</a>
31+
<a href={`${nextUrl}`} class="pagination__link">&#8250;</a>
3232
)}
3333

3434
{lastUrl ? (
35-
<a href={`/developers${lastUrl}`} class="pagination__link">&#187;</a>
35+
<a href={`${lastUrl}`} class="pagination__link">&#187;</a>
3636
) : (
3737
<span class="pagination__link disabled">&#187;</span>
3838
)}

src/pages/blog/[...id].astro

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@ import BlogLayout from '../../layouts/BlogLayout.astro';
44
import CommunityLinks from "../../components/blog/CommunityLinks.astro";
55
66
export async function getStaticPaths() {
7-
const posts = await getCollection('blog');
8-
return posts.map(post => ({
9-
params: { id: post.id },
10-
props: { post },
7+
const blogEntries = await getCollection('blog');
8+
return blogEntries.map(entry => ({
9+
params: { id: entry.id },
10+
props: { entry },
1111
}));
1212
}
1313
14-
const { post } = Astro.props;
15-
const { Content } = await render(post);
14+
const { entry } = Astro.props;
15+
const { Content } = await render(entry);
1616
---
17-
<BlogLayout frontmatter={post.data}>
17+
<BlogLayout frontmatter={entry.data}>
1818
<Content />
1919
<CommunityLinks />
2020
</BlogLayout>
21-

0 commit comments

Comments
 (0)