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/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