From c4cf0dcb022ff826433b63b8ff68830bb8503895 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Sun, 18 Jun 2023 17:47:07 +0000
Subject: [PATCH] local and global graph
---
quartz/components/scripts/spa.inline.ts | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/quartz/components/scripts/spa.inline.ts b/quartz/components/scripts/spa.inline.ts
index a129dc4..057aa3d 100644
--- a/quartz/components/scripts/spa.inline.ts
+++ b/quartz/components/scripts/spa.inline.ts
@@ -29,8 +29,8 @@
return { url: new URL(href), scroll: 'routerNoscroll' in a.dataset ? false : undefined }
}
-function notifyNav(slug: string) {
- const event = new CustomEvent("nav", { detail: { slug } })
+function notifyNav(url: string) {
+ const event: CustomEventMap["nav"] = new CustomEvent("nav", { detail: { url } })
document.dispatchEvent(event)
}
@@ -73,6 +73,8 @@
delete announcer.dataset.persist
}
+window.spaNavigate = navigate
+
function createRouter() {
if (typeof window !== "undefined") {
window.addEventListener("click", async (event) => {
--
Gitblit v1.10.0