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 }