From 6d49d975598cd7f48e2b7347c2b83d8aac6a2f56 Mon Sep 17 00:00:00 2001
From: Aswanth <aswanth366@gmail.com>
Date: Sat, 24 May 2025 04:55:07 +0000
Subject: [PATCH] fix(analytics): streamline posthog script loading and event capturing (#1974)

---
 docs/features/explorer.md |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/docs/features/explorer.md b/docs/features/explorer.md
index 3a3c1e1..4d1fbfb 100644
--- a/docs/features/explorer.md
+++ b/docs/features/explorer.md
@@ -131,7 +131,8 @@
 ```ts title="quartz.layout.ts"
 Component.Explorer({
   mapFn: (node) => {
-    return (node.displayName = node.displayName.toUpperCase())
+    node.displayName = node.displayName.toUpperCase()
+    return node
   },
 })
 ```
@@ -145,8 +146,12 @@
 Component.Explorer({
   filterFn: (node) => {
     // set containing names of everything you want to filter out
-    const omit = new Set(["authoring content", "tags", "hosting"])
-    return !omit.has(node.data.title.toLowerCase())
+    const omit = new Set(["authoring content", "tags", "advanced"])
+
+    // can also use node.slug or by anything on node.data
+    // note that node.data is only present for files that exist on disk
+    // (e.g. implicit folder nodes that have no associated index.md)
+    return !omit.has(node.displayName.toLowerCase())
   },
 })
 ```
@@ -159,7 +164,7 @@
 Component.Explorer({
   filterFn: (node) => {
     // exclude files with the tag "explorerexclude"
-    return node.data.tags.includes("explorerexclude") !== true
+    return node.data.tags?.includes("explorerexclude") !== true
   },
 })
 ```

--
Gitblit v1.10.0