From 041a4ce7bc39c65483eaeeddc97e6946cb49f540 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 24 Jul 2023 07:04:01 +0000
Subject: [PATCH] fix watch-mode batching

---
 quartz/plugins/transformers/links.ts |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts
index e496171..7e8a278 100644
--- a/quartz/plugins/transformers/links.ts
+++ b/quartz/plugins/transformers/links.ts
@@ -29,7 +29,7 @@
   const opts = { ...defaultOptions, ...userOpts }
   return {
     name: "LinkProcessing",
-    htmlPlugins() {
+    htmlPlugins(ctx) {
       return [
         () => {
           return (tree, file) => {
@@ -40,11 +40,8 @@
               if (opts.markdownLinkResolution === "relative") {
                 return targetSlug as RelativeURL
               } else if (opts.markdownLinkResolution === "shortest") {
-                // https://forum.obsidian.md/t/settings-new-link-format-what-is-shortest-path-when-possible/6748/5
-                const allSlugs = file.data.allSlugs!
-
                 // if the file name is unique, then it's just the filename
-                const matchingFileNames = allSlugs.filter((slug) => {
+                const matchingFileNames = ctx.allSlugs.filter((slug) => {
                   const parts = slug.split(path.posix.sep)
                   const fileName = parts.at(-1)
                   return targetCanonical === fileName

--
Gitblit v1.10.0