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'.
This commit is contained in:
2026-05-24 17:50:08 -07:00
parent 5e60415311
commit 330032eea3

View File

@@ -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: '',
}));