Skip to content

Commit 398138e

Browse files
committed
Fix: add basePath to image URLs for GitHub Pages
1 parent b02c22e commit 398138e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

docs/documentation/app/home-content.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ import {
4242
import { Button } from "../components/ui/button";
4343
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../components/ui/card";
4444

45+
const basePath = process.env.GITHUB_PAGES === 'true' ? '/UrbanReflex' : '';
46+
4547
export function HomeContent() {
4648
return (
4749
<>
@@ -52,7 +54,7 @@ export function HomeContent() {
5254
<div className="flex items-center gap-3">
5355
<div className="w-20 h-20 bg-white border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex items-center justify-center p-1.5">
5456
<img
55-
src="/img/logo.png"
57+
src={`${basePath}/img/logo.png`}
5658
alt="UrbanReflex Logo"
5759
width={200}
5860
height={200}
@@ -459,7 +461,7 @@ export function HomeContent() {
459461
<div className="flex items-center justify-center md:justify-start gap-3 mb-4">
460462
<div className="w-20 h-20 bg-white border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex items-center justify-center p-1.5">
461463
<img
462-
src="/img/logo.png"
464+
src={`${basePath}/img/logo.png`}
463465
alt="UrbanReflex Logo"
464466
width={200}
465467
height={200}

docs/documentation/app/layout.config.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,15 @@
2222

2323
import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
2424

25+
const basePath = process.env.GITHUB_PAGES === 'true' ? '/UrbanReflex' : '';
26+
2527
export const baseOptions: BaseLayoutProps = {
2628
nav: {
2729
title: (
2830
<div className="flex items-center gap-3">
2931
<div className="w-20 h-20 bg-white border-2 border-black shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] flex items-center justify-center p-1.5">
3032
<img
31-
src="/img/logo.png"
33+
src={`${basePath}/img/logo.png`}
3234
alt="UrbanReflex Logo"
3335
width={200}
3436
height={200}

0 commit comments

Comments
 (0)