mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 05:14:06 -06:00
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:
parent
f334e78ed6
commit
987a407e55
@ -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
|
||||
|
||||
You can access the tags of a file by `node.data.tags`.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user