diff --git a/docs/configuration.md b/docs/configuration.md index f2f003d5f..6c1fb7d88 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -135,6 +135,6 @@ typography: { The home page is the main web page of your Quartz. The content for the home page lives in `content/index.md`, to change it see [[authoring content|the authoring content guide]]. -To enable easy customization, the `homePage` emitter allows you to fully rearrange the layout of the home page. The default home page layout is called `defaultHomePageLayout{:ts}` and can be found in `quartz.layout.ts`. The layout of the home page and all other content pages is the same by default. See [[layout|the layout documentation]] for further guidance. +To enable easy customization, Quartz allows you to fully rearrange the layout of the home page. The default home page layout is called `defaultHomePageLayout{:ts}` and can be found in `quartz.layout.ts`. The layout of the home page is the same as all other content pages by default. See [[layout|the layout documentation]] for further guidance on changing the layout. -A differnet method is used to configure the comment box on the home page, see [[Comments#Conditionally display comments|conditionally display comments]]. +A different method is used to configure the comment box on the home page, see [[Comments#Conditionally display comments|conditionally display comments]]. diff --git a/quartz.layout.ts b/quartz.layout.ts index d9917511b..16618660a 100644 --- a/quartz.layout.ts +++ b/quartz.layout.ts @@ -67,7 +67,7 @@ export const defaultListPageLayout: PageLayout = { export const defaultHomePageLayout: HomePageLayout = { ...sharedPageComponents, ...defaultContentPageLayout, - // head: Component.Head(), + // head: Component.Head(), // header: [], // left: [], // beforeBody: [], diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx index 4801f1604..eb5c6837f 100644 --- a/quartz/plugins/emitters/contentPage.tsx +++ b/quartz/plugins/emitters/contentPage.tsx @@ -10,7 +10,11 @@ import { pageResources, renderPage } from "../../components/renderPage" import { FullPageLayout } from "../../cfg" import { Argv } from "../../util/ctx" import { FilePath, isRelativeURL, joinSegments, pathToRoot } from "../../util/path" -import { defaultContentPageLayout, sharedPageComponents } from "../../../quartz.layout" +import { + defaultContentPageLayout, + sharedPageComponents, + defaultHomePageLayout, +} from "../../../quartz.layout" import { Content } from "../../components" import chalk from "chalk" import { write } from "./helpers" @@ -52,7 +56,7 @@ const parseDependencies = (argv: Argv, hast: Root, file: VFile): string[] => { } export const ContentPage: QuartzEmitterPlugin> = (userOpts) => { - const opts: FullPageLayout = { + let opts: FullPageLayout = { ...sharedPageComponents, ...defaultContentPageLayout, pageBody: Content(), @@ -103,7 +107,18 @@ export const ContentPage: QuartzEmitterPlugin> = (userOp const slug = file.data.slug! if (slug === "index") { containsIndex = true - continue + opts = { + ...defaultHomePageLayout, + pageBody: Content(), + ...userOpts, + } + } else { + opts = { + ...sharedPageComponents, + ...defaultContentPageLayout, + pageBody: Content(), + ...userOpts, + } } if (file.data.slug?.endsWith("/index")) {