From c874e7e9378a5ba895870e9680484fb4af5c6e93 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 19 Aug 2023 22:52:25 +0000
Subject: [PATCH] base path refactor to better support subpath hosting

---
 quartz/components/Head.tsx |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/quartz/components/Head.tsx b/quartz/components/Head.tsx
index bfeb3f1..5221c29 100644
--- a/quartz/components/Head.tsx
+++ b/quartz/components/Head.tsx
@@ -1,14 +1,13 @@
-import { canonicalizeServer, pathToRoot } from "../util/path"
+import { pathToRoot } from "../util/path"
 import { JSResourceToScriptElement } from "../util/resources"
 import { QuartzComponentConstructor, QuartzComponentProps } from "./types"
 
 export default (() => {
   function Head({ cfg, fileData, externalResources }: QuartzComponentProps) {
-    const slug = canonicalizeServer(fileData.slug!)
     const title = fileData.frontmatter?.title ?? "Untitled"
     const description = fileData.description?.trim() ?? "No description provided"
     const { css, js } = externalResources
-    const baseDir = pathToRoot(slug)
+    const baseDir = pathToRoot(fileData.slug!)
     const iconPath = baseDir + "/static/icon.png"
     const ogImagePath = `https://${cfg.baseUrl}/static/og-image.png`
 

--
Gitblit v1.10.0