Skip to content

Commit 53e8c52

Browse files
committed
fix: resolve issue with non-root page direct navigation improperly loading styling
1 parent 00a930e commit 53e8c52

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

quartz/components/renderPage.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,18 @@ export function pageResources(
2828
baseDir: FullSlug | RelativeURL,
2929
staticResources: StaticResources,
3030
): StaticResources {
31-
const contentIndexPath = joinSegments(baseDir, "static/contentIndex.json")
32-
const contentIndexScript = `const fetchData = fetch("${contentIndexPath}").then(data => data.json())`
31+
const contentIndexScript = `const fetchData = fetch("/static/contentIndex.json").then(data => data.json())`
3332

3433
const resources: StaticResources = {
3534
css: [
3635
{
37-
content: joinSegments(baseDir, "index.css"),
36+
content: "/index.css",
3837
},
3938
...staticResources.css,
4039
],
4140
js: [
4241
{
43-
src: joinSegments(baseDir, "prescript.js"),
42+
src: "/prescript.js",
4443
loadTime: "beforeDOMReady",
4544
contentType: "external",
4645
},
@@ -56,7 +55,7 @@ export function pageResources(
5655
}
5756

5857
resources.js.push({
59-
src: joinSegments(baseDir, "postscript.js"),
58+
src: "/postscript.js",
6059
loadTime: "afterDOMReady",
6160
moduleType: "module",
6261
contentType: "external",

0 commit comments

Comments
 (0)