From 2bfe90b7e64839d8ec6319fe93b76472b0285114 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 12 Jun 2023 06:46:38 +0000
Subject: [PATCH] add config to components

---
 quartz/plugins/emitters/contentPage.tsx |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx
index b7059f8..9b789ef 100644
--- a/quartz/plugins/emitters/contentPage.tsx
+++ b/quartz/plugins/emitters/contentPage.tsx
@@ -5,9 +5,9 @@
 import { GlobalConfiguration } from "../../cfg"
 import { QuartzComponent } from "../../components/types"
 import { resolveToRoot } from "../../path"
-import Header from "../../components/Header"
+import HeaderConstructor from "../../components/Header"
 import { QuartzComponentProps } from "../../components/types"
-import Body from "../../components/Body"
+import BodyConstructor from "../../components/Body"
 
 interface Options {
   head: QuartzComponent
@@ -20,6 +20,10 @@
     throw new Error("ContentPage must be initialized with options specifiying the components to use")
   }
 
+  const { head: Head, header, body } = opts
+  const Header = HeaderConstructor()
+  const Body = BodyConstructor()
+
   return {
     name: "ContentPage",
     getQuartzComponents() {
@@ -28,7 +32,6 @@
     async emit(cfg: GlobalConfiguration, content: ProcessedContent[], resources: StaticResources, emit: EmitCallback): Promise<string[]> {
       const fps: string[] = []
 
-      const { head: Head, header, body } = opts
       for (const [tree, file] of content) {
         const baseDir = resolveToRoot(file.data.slug!)
         const pageResources: StaticResources = {

--
Gitblit v1.10.0