Skip to content

Commit 244ea62

Browse files
allen108108claude
andcommitted
Fix BASE_URL path separator for logo and internal links
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 6124cdf commit 244ea62

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/components/HeaderLink.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const subpath = pathname.match(/[^\/]+/g);
99
const isActive = href === pathname || href === '/' + (subpath?.[0] || '');
1010
---
1111

12-
<a href={`${import.meta.env.BASE_URL}${href.replace(/^\//, '')}`} class:list={[className, { active: isActive }]} {...props}>
12+
<a href={`${import.meta.env.BASE_URL}/${href.replace(/^\//, '')}`.replace('//', '/')} class:list={[className, { active: isActive }]} {...props}>
1313
<slot />
1414
</a>
1515
<style>

src/pages/blog/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const posts = (await getCollection('blog')).sort(
9494
{
9595
posts.map((post) => (
9696
<li>
97-
<a href={`${import.meta.env.BASE_URL}blog/${post.id}/`}>
97+
<a href={`${import.meta.env.BASE_URL}/blog/${post.id}/`.replace('//', '/')}>
9898
{post.data.heroImage && (
9999
<Image width={720} height={360} src={post.data.heroImage} alt="" />
100100
)}

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { SITE_DESCRIPTION, SITE_TITLE } from '../consts';
1313
<body>
1414
<Header />
1515
<main>
16-
<h1 style="display: flex; align-items: center; gap: 0.4em;"><img src={`${import.meta.env.BASE_URL}logo.png`} alt="" width="80" height="80" style="min-width:80px;" /> Hello, Builder!</h1>
16+
<h1 style="display: flex; align-items: center; gap: 0.4em;"><img src={`${import.meta.env.BASE_URL}/logo.png`.replace('//', '/')} alt="" width="80" height="80" style="min-width:80px;" /> Hello, Builder!</h1>
1717
<p>
1818
Welcome to the <strong>OpenAB Blog</strong> — where we share project updates, technical deep dives, and stories from the open-source agent builder community.
1919
</p>

0 commit comments

Comments
 (0)