Jacky Zhao
2025-04-04 4d6e7ccba9077a6ec288d12a1502110362300392
chore(docs): fix explorer docs on filtering by title
1 files modified
13 ■■■■■ changed files
docs/features/explorer.md 13 ●●●●● patch | view | raw | blame | history
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
  },
})
```