Update explorer.md

Currently the proposed filter by title is not working; Let's add filter by slug alternative for now.
This commit is contained in:
Timothee 2025-04-04 07:22:08 +02:00 committed by GitHub
parent f334e78ed6
commit 987a407e55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -151,6 +151,19 @@ Component.Explorer({
}) })
``` ```
Alternatively, here's how to filter by slug:
```ts title="quartz.layout.ts"
// Filter by slug
Component.Explorer({
filterFn: (node) => {
// set containing slugs of everything you want to filter out
const omit = new Set(["authoring content", "tags", "hosting"])
return !omit.has((node.slug ?? "").split("/")[0])
},
})
```
### Remove files by tag ### Remove files by tag
You can access the tags of a file by `node.data.tags`. You can access the tags of a file by `node.data.tags`.