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:
@@ -408,7 +408,10 @@ export const PageProvider: React.FC<{ children: ReactNode }> = ({ children }) =>
|
|||||||
const built = newPages.map((p, i) => ({
|
const built = newPages.map((p, i) => ({
|
||||||
id: i === 0 ? 'home' : `page_${Date.now()}_${i}`,
|
id: i === 0 ? 'home' : `page_${Date.now()}_${i}`,
|
||||||
name: p.name,
|
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),
|
craftState: treeToState(p.tree),
|
||||||
headCode: '',
|
headCode: '',
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user