From 330032eea3acf92ac94a2493781a66af505ab575 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 24 May 2026 17:50:08 -0700 Subject: [PATCH] sitesmith: publish home page to index.html, not home.html replaceAllPages was slugifying every page name including the first, so the home page landed at home.html. Apache resolves '/' to index.html, so the published root URL appeared blank while the actual content was at /home.html. First page now hard-codes slug='index'. --- craft/src/state/PageContext.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/craft/src/state/PageContext.tsx b/craft/src/state/PageContext.tsx index 38e7e32..34b7823 100644 --- a/craft/src/state/PageContext.tsx +++ b/craft/src/state/PageContext.tsx @@ -408,7 +408,10 @@ export const PageProvider: React.FC<{ children: ReactNode }> = ({ children }) => const built = newPages.map((p, i) => ({ id: i === 0 ? 'home' : `page_${Date.now()}_${i}`, name: p.name, - slug: slugify(p.name), + // First page must publish to index.html so it serves at the site root. + // Apache resolves '/' to index.html, not home.html — without this, the + // AI's "Home" page lands at /home.html and visitors hit a blank root. + slug: i === 0 ? 'index' : slugify(p.name), craftState: treeToState(p.tree), headCode: '', }));