From 3ce6aa49bf25b26a4cb1bf18e9770271d132772d Mon Sep 17 00:00:00 2001
From: Karim <46734059+h-karim@users.noreply.github.com>
Date: Fri, 21 Mar 2025 23:49:56 +0000
Subject: [PATCH] fix(ogImage): update socialImage path to include base URL if defined (#1858)
---
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