mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
fix: add trailing slash to links to avoid extra redirects (#246)
Add trailing slash to links for improved consistency with RSS links and to avoid unnecessary redirects. --------- Co-authored-by: satnaing <satnaingdev@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ const { currentPage, totalPages, paginatedPosts } = Astro.props;
|
||||
<ul>
|
||||
{
|
||||
paginatedPosts.map(({ data, slug }) => (
|
||||
<Card href={`/posts/${slug}`} frontmatter={data} />
|
||||
<Card href={`/posts/${slug}/`} frontmatter={data} />
|
||||
))
|
||||
}
|
||||
</ul>
|
||||
@@ -32,8 +32,8 @@ const { currentPage, totalPages, paginatedPosts } = Astro.props;
|
||||
<Pagination
|
||||
{currentPage}
|
||||
{totalPages}
|
||||
prevUrl={`/posts${currentPage - 1 !== 1 ? "/" + (currentPage - 1) : ""}`}
|
||||
nextUrl={`/posts/${currentPage + 1}`}
|
||||
prevUrl={`/posts${currentPage - 1 !== 1 ? "/" + (currentPage - 1) : ""}/`}
|
||||
nextUrl={`/posts/${currentPage + 1}/`}
|
||||
/>
|
||||
|
||||
<Footer noMarginTop={totalPages > 1} />
|
||||
|
||||
Reference in New Issue
Block a user