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
@@ -77,7 +77,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
<ul>
{featuredPosts.map(({ data, slug }) => (
<Card
href={`/posts/${slug}`}
href={`/posts/${slug}/`}
frontmatter={data}
secHeading={false}
/>
@@ -98,7 +98,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
({ data, slug }, index) =>
index < 4 && (
<Card
href={`/posts/${slug}`}
href={`/posts/${slug}/`}
frontmatter={data}
secHeading={false}
/>
@@ -110,7 +110,7 @@ const socialCount = SOCIALS.filter(social => social.active).length;
}
<div class="all-posts-btn-wrapper">
<LinkButton href="/posts">
<LinkButton href="/posts/">
All Posts
<svg xmlns="http://www.w3.org/2000/svg"
><path
+1 -1
View File
@@ -11,7 +11,7 @@ export async function GET() {
description: SITE.desc,
site: SITE.website,
items: sortedPosts.map(({ data, slug }) => ({
link: `posts/${slug}`,
link: `posts/${slug}/`,
title: data.title,
description: data.description,
pubDate: new Date(data.modDatetime ?? data.pubDatetime),