Skip to content

Commit 2eca113

Browse files
JacobCoffeeclaude
andcommitted
fix search index fetch path and add blog.python.org migration note
The command palette was fetching /search-index.json without the base path prefix, causing 404 on GitHub Pages. Also added a comment in astro.config.ts noting the site/base values for blog.python.org. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9b48430 commit 2eca113

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

astro.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ if (isDev) {
2424
integrations.push(keystatic());
2525
}
2626

27+
// When moving to blog.python.org, change site and remove base:
28+
// site: "https://blog.python.org",
29+
// base: "/",
2730
export default defineConfig({
2831
site: "https://jacobcoffee.github.io",
2932
base: isDev ? "/" : "/python-insider-blog",

src/components/CommandPalette.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export default function CommandPalette({ open: controlledOpen, onOpenChange }: P
186186
fetchedRef.current = true;
187187
setLoading(true);
188188

189-
fetch("/search-index.json")
189+
fetch(withBase("/search-index.json"))
190190
.then((res) => res.json())
191191
.then((data: PostEntry[]) => setPosts(data))
192192
.catch((err) => console.error("Failed to load search index:", err))

0 commit comments

Comments
 (0)