From c7707322f96d1571386b7cd2b2c74effa99a699e Mon Sep 17 00:00:00 2001 From: Aaron Pham Date: Wed, 1 Jan 2025 11:55:23 -0800 Subject: [PATCH] fix: make sure to run spa last Signed-off-by: Aaron Pham --- quartz/components/renderPage.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx index 55ea057a4..3914411ac 100644 --- a/quartz/components/renderPage.tsx +++ b/quartz/components/renderPage.tsx @@ -53,12 +53,6 @@ export function pageResources( script: contentIndexScript, }, ...staticResources.js, - { - src: joinSegments(baseDir, "postscript.js"), - loadTime: "afterDOMReady", - moduleType: "module", - contentType: "external", - }, ], } @@ -72,6 +66,14 @@ export function pageResources( resources.css.push({ content: mermaidStyle, inline: true }) } + // NOTE: we have to put this last to make sure spa.inline.ts is the last item. + resources.js.push({ + src: joinSegments(baseDir, "postscript.js"), + loadTime: "afterDOMReady", + moduleType: "module", + contentType: "external", + }) + return resources }