File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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 ) ;
Original file line number Diff line number Diff line change 11"use client" ;
22
33import { useEffect } from "react" ;
4- import { getBasePath } from "@/lib/utils" ;
54
65interface 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 }
You can’t perform that action at this time.
0 commit comments