From 9316ddf2f5ca7d0a08b06a9a6d548e9ad180fc4f Mon Sep 17 00:00:00 2001
From: Taha <62564400+mt190502@users.noreply.github.com>
Date: Fri, 21 Mar 2025 16:58:10 +0000
Subject: [PATCH] fix(analytics): fix the load of the analytics scripts (#1865)
---
quartz/util/fileTrie.ts | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/quartz/util/fileTrie.ts b/quartz/util/fileTrie.ts
index b39833c..e3dc2e7 100644
--- a/quartz/util/fileTrie.ts
+++ b/quartz/util/fileTrie.ts
@@ -89,6 +89,14 @@
this.insert(file.slug.split("/"), file)
}
+ findNode(path: string[]): FileTrieNode<T> | undefined {
+ if (path.length === 0 || (path.length === 1 && path[0] === "index")) {
+ return this
+ }
+
+ return this.children.find((c) => c.slugSegment === path[0])?.findNode(path.slice(1))
+ }
+
/**
* Filter trie nodes. Behaves similar to `Array.prototype.filter()`, but modifies tree in place
*/
--
Gitblit v1.10.0