From 6ecdcb5e24f2783e6fa73de69e848f0f319c4fc4 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 13 Sep 2023 05:55:50 +0000
Subject: [PATCH] feat: resolve block references in obsidian markdown
---
quartz/components/renderPage.tsx | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx
index a1d5fee..25297f2 100644
--- a/quartz/components/renderPage.tsx
+++ b/quartz/components/renderPage.tsx
@@ -3,7 +3,7 @@
import HeaderConstructor from "./Header"
import BodyConstructor from "./Body"
import { JSResourceToScriptElement, StaticResources } from "../util/resources"
-import { FullSlug, joinSegments, pathToRoot } from "../util/path"
+import { FullSlug, RelativeURL, joinSegments } from "../util/path"
interface RenderComponents {
head: QuartzComponent
@@ -15,9 +15,10 @@
footer: QuartzComponent
}
-export function pageResources(slug: FullSlug, staticResources: StaticResources): StaticResources {
- const baseDir = pathToRoot(slug)
-
+export function pageResources(
+ baseDir: FullSlug | RelativeURL,
+ staticResources: StaticResources,
+): StaticResources {
const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json")
const contentIndexScript = `const fetchData = fetch(\`${contentIndexPath}\`).then(data => data.json())`
@@ -25,7 +26,7 @@
css: [joinSegments(baseDir, "index.css"), ...staticResources.css],
js: [
{
- src: joinSegments(baseDir, "/prescript.js"),
+ src: joinSegments(baseDir, "prescript.js"),
loadTime: "beforeDOMReady",
contentType: "external",
},
@@ -37,7 +38,7 @@
},
...staticResources.js,
{
- src: baseDir + "/postscript.js",
+ src: joinSegments(baseDir, "postscript.js"),
loadTime: "afterDOMReady",
moduleType: "module",
contentType: "external",
--
Gitblit v1.10.0