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:
面条
2024-01-25 11:54:28 +08:00
committed by GitHub
parent b05ab6213e
commit b3a1d9d369
8 changed files with 17 additions and 17 deletions
+3 -3
View File
@@ -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} />