From eccad3da5d7b84b0f78a85b357efedef8c0127fc Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Wed, 19 Mar 2025 04:48:24 +0000
Subject: [PATCH] fix(lastmod): fallback to ctx.arg.directory instead of empty string
---
quartz/components/scripts/toc.inline.ts | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/quartz/components/scripts/toc.inline.ts b/quartz/components/scripts/toc.inline.ts
index a518c10..6c5ad1c 100644
--- a/quartz/components/scripts/toc.inline.ts
+++ b/quartz/components/scripts/toc.inline.ts
@@ -25,16 +25,15 @@
}
function setupToc() {
- const toc = document.getElementById("toc")
- if (toc) {
- const content = toc.nextElementSibling as HTMLElement | undefined
- if (!content) return
- toc.addEventListener("click", toggleToc)
- window.addCleanup(() => toc.removeEventListener("click", toggleToc))
+ for (const toc of document.getElementsByClassName("toc")) {
+ const button = toc.querySelector(".toc-header")
+ const content = toc.querySelector(".toc-content")
+ if (!button || !content) return
+ button.addEventListener("click", toggleToc)
+ window.addCleanup(() => button.removeEventListener("click", toggleToc))
}
}
-window.addEventListener("resize", setupToc)
document.addEventListener("nav", () => {
setupToc()
--
Gitblit v1.10.0