From 696403d3fa79f79fa3340bb1fe11533d1fdaf0a4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 13 Mar 2025 17:55:37 +0000
Subject: [PATCH] chore: bump version to 4.4.1
---
quartz/components/renderPage.tsx | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx
index 9c53096..a43b66c 100644
--- a/quartz/components/renderPage.tsx
+++ b/quartz/components/renderPage.tsx
@@ -3,11 +3,13 @@
import HeaderConstructor from "./Header"
import BodyConstructor from "./Body"
import { JSResourceToScriptElement, StaticResources } from "../util/resources"
-import { clone, FullSlug, RelativeURL, joinSegments, normalizeHastElement } from "../util/path"
+import { FullSlug, RelativeURL, joinSegments, normalizeHastElement } from "../util/path"
+import { clone } from "../util/clone"
import { visit } from "unist-util-visit"
import { Root, Element, ElementContent } from "hast"
import { GlobalConfiguration } from "../cfg"
import { i18n } from "../i18n"
+import { QuartzPluginData } from "../plugins/vfile"
interface RenderComponents {
head: QuartzComponent
@@ -23,12 +25,13 @@
const headerRegex = new RegExp(/h[1-6]/)
export function pageResources(
baseDir: FullSlug | RelativeURL,
+ fileData: QuartzPluginData,
staticResources: StaticResources,
): StaticResources {
const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json")
const contentIndexScript = `const fetchData = fetch("${contentIndexPath}").then(data => data.json())`
- return {
+ const resources: StaticResources = {
css: [
{
content: joinSegments(baseDir, "index.css"),
@@ -48,14 +51,18 @@
script: contentIndexScript,
},
...staticResources.js,
- {
- src: joinSegments(baseDir, "postscript.js"),
- loadTime: "afterDOMReady",
- moduleType: "module",
- contentType: "external",
- },
],
+ additionalHead: staticResources.additionalHead,
}
+
+ resources.js.push({
+ src: joinSegments(baseDir, "postscript.js"),
+ loadTime: "afterDOMReady",
+ moduleType: "module",
+ contentType: "external",
+ })
+
+ return resources
}
export function renderPage(
--
Gitblit v1.10.0