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:
@@ -44,7 +44,7 @@ breadcrumbList[0] === "tags" &&
|
||||
</li>
|
||||
) : (
|
||||
<li>
|
||||
<a href={`/${breadcrumb}`}>{breadcrumb}</a>
|
||||
<a href={`/${breadcrumb}/`}>{breadcrumb}</a>
|
||||
<span aria-hidden="true">»</span>
|
||||
</li>
|
||||
)
|
||||
|
||||
@@ -56,23 +56,23 @@ const { activeNav } = Astro.props;
|
||||
</button>
|
||||
<ul id="menu-items" class="display-none sm:flex">
|
||||
<li>
|
||||
<a href="/posts" class={activeNav === "posts" ? "active" : ""}>
|
||||
<a href="/posts/" class={activeNav === "posts" ? "active" : ""}>
|
||||
Posts
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/tags" class={activeNav === "tags" ? "active" : ""}>
|
||||
<a href="/tags/" class={activeNav === "tags" ? "active" : ""}>
|
||||
Tags
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/about" class={activeNav === "about" ? "active" : ""}>
|
||||
<a href="/about/" class={activeNav === "about" ? "active" : ""}>
|
||||
About
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<LinkButton
|
||||
href="/search"
|
||||
href="/search/"
|
||||
className={`focus-outline p-3 sm:p-1 ${
|
||||
activeNav === "search" ? "active" : ""
|
||||
} flex`}
|
||||
|
||||
@@ -112,7 +112,7 @@ export default function SearchBar({ searchList }: Props) {
|
||||
{searchResults &&
|
||||
searchResults.map(({ item, refIndex }) => (
|
||||
<Card
|
||||
href={`/posts/${item.slug}`}
|
||||
href={`/posts/${item.slug}/`}
|
||||
frontmatter={item.data}
|
||||
key={`${refIndex}-${item.slug}`}
|
||||
/>
|
||||
|
||||
@@ -13,7 +13,7 @@ const { tag, size = "sm" } = Astro.props;
|
||||
}`}
|
||||
>
|
||||
<a
|
||||
href={`/tags/${tag}`}
|
||||
href={`/tags/${tag}/`}
|
||||
transition:name={tag}
|
||||
class={`${size === "sm" ? "text-sm" : "text-lg"} pr-2 group`}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user