From 60a3c543398aed8caf44b411a4dc10e8d1e26fcc Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 13 Sep 2023 04:29:57 +0000
Subject: [PATCH] fix: 404 page styling for nested pages (closes #458)
---
quartz/components/renderPage.tsx | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/quartz/components/renderPage.tsx b/quartz/components/renderPage.tsx
index eb1291f..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())`
--
Gitblit v1.10.0