From 4bdc17d4a11f0ba517c6d9124d296458332c536b Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 03 Jun 2023 19:07:19 +0000
Subject: [PATCH] inline scripts

---
 quartz/path.ts |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/quartz/path.ts b/quartz/path.ts
index 4f3bfa7..aa3870b 100644
--- a/quartz/path.ts
+++ b/quartz/path.ts
@@ -22,11 +22,15 @@
 // resolve /a/b/c to ../../
 export function resolveToRoot(slug: string): string {
   let fp = slug
-  if (fp.endsWith("/index")) {
-    fp = fp.slice(0, -"/index".length)
+  if (fp.endsWith("index")) {
+    fp = fp.slice(0, -"index".length)
   }
 
-  return fp
+  if (fp === "") {
+    return "."
+  }
+
+  return "./" + fp
     .split('/')
     .filter(x => x !== '')
     .map(_ => '..')

--
Gitblit v1.10.0