From 78f4cdbe109308fa33cb87387952aef5a528ebbe Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sat, 19 Aug 2023 23:40:02 +0000
Subject: [PATCH] avoid 404 on icon for spa navigations with anchors

---
 quartz/bootstrap-cli.mjs |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs
index 1178303..643733f 100755
--- a/quartz/bootstrap-cli.mjs
+++ b/quartz/bootstrap-cli.mjs
@@ -19,7 +19,7 @@
 
 const ORIGIN_NAME = "origin"
 const UPSTREAM_NAME = "upstream"
-const QUARTZ_SOURCE_BRANCH = "v4-alpha"
+const QUARTZ_SOURCE_BRANCH = "v4"
 const cwd = process.cwd()
 const cacheDir = path.join(cwd, ".quartz-cache")
 const cacheFile = "./.quartz-cache/transpiled-build.mjs"
@@ -192,7 +192,10 @@
 
       await rmContentFolder()
       if (setupStrategy === "copy") {
-        await fs.promises.cp(originalFolder, contentFolder, { recursive: true })
+        await fs.promises.cp(originalFolder, contentFolder, {
+          recursive: true,
+          preserveTimestamps: true,
+        })
       } else if (setupStrategy === "symlink") {
         await fs.promises.symlink(originalFolder, contentFolder, "dir")
       }
@@ -292,7 +295,6 @@
 
         // follow symlink and copy content
         await fs.promises.cp(linkTarg, contentFolder, {
-          force: true,
           recursive: true,
           preserveTimestamps: true,
         })
@@ -302,7 +304,8 @@
         dateStyle: "medium",
         timeStyle: "short",
       })
-      spawnSync("git", ["commit", "-am", `Quartz sync: ${currentTimestamp}`], { stdio: "inherit" })
+      spawnSync("git", ["add", "."], { stdio: "inherit" })
+      spawnSync("git", ["commit", "-m", `Quartz sync: ${currentTimestamp}`], { stdio: "inherit" })
 
       if (contentStat.isSymbolicLink()) {
         // put symlink back

--
Gitblit v1.10.0