Skip to content

Commit 76932f4

Browse files
committed
Fix bug in path assignment for index search
1 parent 5be1be0 commit 76932f4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

catalog/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ export default function RootLayout({
3030
<body className="antialiased">
3131
{children}
3232
{/* Pagefind UI - loads after static build */}
33-
<Script src={`${basePath}/_pagefind/pagefind-ui.js`} strategy="afterInteractive" />
33+
{/* Next.js automatically adds basePath from config, so just use relative path */}
34+
<Script src="/_pagefind/pagefind-ui.js" strategy="afterInteractive" />
3435
</body>
3536
</html>
3637
);

catalog/components/search-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
"use client";
22

33
import { useEffect } from "react";
4-
import { getBasePath } from "@/lib/utils";
54

65
interface PagefindUIOptions {
76
element: HTMLElement;
@@ -34,6 +33,7 @@ export default function SearchBar() {
3433
if (!document.querySelector('link[href*="pagefind-ui.css"]')) {
3534
const link = document.createElement("link");
3635
link.rel = "stylesheet";
36+
// Use basePath for CSS since it's loaded dynamically
3737
link.href = `${basePath}/_pagefind/pagefind-ui.css`;
3838
document.head.appendChild(link);
3939
}

0 commit comments

Comments
 (0)