From 1cb4dadf13913009660685b6f2c163c939e2a51a Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 07 Jun 2023 04:19:00 +0000
Subject: [PATCH] codeblock copy
---
quartz/plugins/emitters/contentPage.tsx | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx
index 61ddcfb..c4b357c 100644
--- a/quartz/plugins/emitters/contentPage.tsx
+++ b/quartz/plugins/emitters/contentPage.tsx
@@ -9,10 +9,12 @@
import { HeaderProps } from "../../components/Header"
import { QuartzComponent } from "../../components/types"
import { resolveToRoot } from "../../path"
+import { BodyProps } from "../../components/Body"
interface Options {
Head: QuartzComponent<HeadProps>
Header: QuartzComponent<HeaderProps>
+ Body: QuartzComponent<BodyProps>
}
export class ContentPage extends QuartzEmitterPlugin {
@@ -31,7 +33,7 @@
async emit(cfg: GlobalConfiguration, content: ProcessedContent[], resources: StaticResources, emit: EmitCallback): Promise<string[]> {
const fps: string[] = []
- const { Head, Header } = this.opts
+ const { Head, Header, Body } = this.opts
for (const [tree, file] of content) {
// @ts-ignore (preact makes it angry)
const content = toJsxRuntime(tree, { Fragment, jsx, jsxs, elementAttributeNameCase: 'html' })
@@ -42,7 +44,7 @@
js: [
{ src: baseDir + "/prescript.js", loadTime: "beforeDOMReady" },
...resources.js,
- { src: baseDir + "/postscript.js", loadTime: "afterDOMReady" }
+ { src: baseDir + "/postscript.js", loadTime: "afterDOMReady", type: 'module' }
]
}
@@ -56,10 +58,7 @@
<body>
<div id="quartz-root" class="page">
<Header title={cfg.siteTitle} slug={file.data.slug!} />
- <article>
- {file.data.slug !== "index" && <h1>{title}</h1>}
- {content}
- </article>
+ <Body title={file.data.slug === "index" ? undefined : title}>{content}</Body>
</div>
</body>
{pageResources.js.filter(resource => resource.loadTime === "afterDOMReady").map(resource => <script key={resource.src} {...resource} />)}
--
Gitblit v1.10.0