Skip to content

Commit 5b532b7

Browse files
committed
fix: Prefix icon and logo paths with basePath for GitHub Pages
1 parent 7bb081f commit 5b532b7

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

app/layout.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import type { Metadata } from 'next'
22
import './globals.css'
33

4+
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || ''
5+
46
export const metadata: Metadata = {
57
title: {
68
default: 'Docs — OpenScan',
@@ -9,13 +11,13 @@ export const metadata: Metadata = {
911
description: 'Official documentation for OpenScan. Learn how it works, self-host, compare features, and understand our privacy policy.',
1012
icons: {
1113
icon: [
12-
{ url: '/icon.svg', type: 'image/svg+xml' },
13-
{ url: '/icon.png', sizes: '512x512', type: 'image/png' },
14+
{ url: `${basePath}/icon.svg`, type: 'image/svg+xml' },
15+
{ url: `${basePath}/icon.png`, sizes: '512x512', type: 'image/png' },
1416
],
1517
apple: [
16-
{ url: '/apple-icon.png', sizes: '180x180', type: 'image/png' },
18+
{ url: `${basePath}/apple-icon.png`, sizes: '180x180', type: 'image/png' },
1719
],
18-
shortcut: '/icon.svg',
20+
shortcut: `${basePath}/icon.svg`,
1921
},
2022
}
2123

components/docs-sidebar.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export function DocsSidebar() {
176176
<div className="sticky top-0 flex h-full max-h-screen flex-col overflow-y-auto px-4 pb-8">
177177
<div className="flex h-14 items-center border-b border-border px-2">
178178
<Link href="/introduction" className="flex items-center gap-2">
179-
<img src="/openscan-logo.svg" alt="OpenScan" className="h-5 w-5" />
179+
<img src={`${process.env.NEXT_PUBLIC_BASE_PATH || ''}/openscan-logo.svg`} alt="OpenScan" className="h-5 w-5" />
180180
<span className="font-semibold text-foreground tracking-tight">
181181
OpenScan Docs
182182
</span>
@@ -195,7 +195,7 @@ export function MobileNav() {
195195
<div className="lg:hidden">
196196
<div className="flex h-14 items-center justify-between border-b border-border px-4">
197197
<Link href="/introduction" className="flex items-center gap-2">
198-
<img src="/openscan-logo.svg" alt="OpenScan" className="h-5 w-5" />
198+
<img src={`${process.env.NEXT_PUBLIC_BASE_PATH || ''}/openscan-logo.svg`} alt="OpenScan" className="h-5 w-5" />
199199
<span className="font-semibold text-foreground tracking-tight">
200200
OpenScan Docs
201201
</span>

0 commit comments

Comments
 (0)