From 173ec240d2ed5b25f18ef42823334ae800b3527d Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 21 Aug 2023 00:50:56 +0000
Subject: [PATCH] fix: jump to anchor on deployed site triggering spa refresh
---
quartz/plugins/transformers/links.ts | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts
index 5d34fa3..d9c9c7c 100644
--- a/quartz/plugins/transformers/links.ts
+++ b/quartz/plugins/transformers/links.ts
@@ -60,7 +60,8 @@
dest,
transformOptions,
)
- const canonicalDest = path.posix.normalize(joinSegments(curSlug, dest))
+ const url = new URL(dest, `https://base.com/${curSlug}`)
+ const canonicalDest = url.pathname
const [destCanonical, _destAnchor] = splitAnchor(canonicalDest)
const simple = simplifySlug(destCanonical as FullSlug)
outgoing.add(simple)
--
Gitblit v1.10.0