mirror of
https://github.com/logos-co/assembly.git
synced 2026-09-01 13:41:13 +00:00
loadQuartzConfig() internally calls loadQuartzLayout() to build the PageTypeDispatcher, which instantiates components. Plugin option overrides must be registered before this happens. Updated quartz.ts and all doc snippets that show the ExternalPlugin override pattern to place calls before loadQuartzConfig(). Also updated OxHugo and Roam docs from stale v4 plugins pattern to v5 override pattern.
2.0 KiB
2.0 KiB
title, tags, image
| title | tags | image | |
|---|---|---|---|
| Explorer |
|
File tree explorer sidebar.
Note
For information on how to add, remove or configure plugins, see the configuration#Plugins page.
See plugins/Explorer for detailed usage information.
Configuration
This plugin accepts the following configuration options:
YAML options (in quartz.config.yaml):
title: The title of the explorer. Defaults toExplorer.folderClickBehavior: The behavior when a folder is clicked. Can be"link"to navigate or"collapse"to toggle. Defaults tolink.folderDefaultState: The default state of folders. Can be"collapsed"or"open". Defaults tocollapsed.useSavedState: Whether to use local storage to save the state of the explorer. Defaults totrue.
TS override options (in quartz.ts, for callback functions that can't be expressed in YAML):
sortFn: Custom sort function for ordering files and folders.filterFn: Custom filter function to exclude specific nodes.mapFn: Custom map function to transform node properties (e.g. display names).order: Array controlling the order of operations. Defaults to["filter", "map", "sort"].
Default options
- source: github:quartz-community/explorer
enabled: true
options:
title: Explorer
folderClickBehavior: link
folderDefaultState: collapsed
useSavedState: true
TS override example
import * as ExternalPlugin from "./.quartz/plugins"
// Must be placed before loadQuartzConfig()
ExternalPlugin.Explorer({
mapFn: (node) => {
node.displayName = node.displayName.toUpperCase()
return node
},
})
See features/explorer#Advanced customization for more examples.
API
- Category: Component
- Function name:
ExternalPlugin.Explorer(). - Source:
quartz-community/explorer - Install:
npx quartz plugin add github:quartz-community/explorer