fix: move ExternalPlugin overrides before loadQuartzConfig in quartz.ts docs
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.
This commit is contained in:
@@ -696,15 +696,15 @@ For options that require JavaScript callback functions (not expressible in YAML)
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.MyPlugin({
|
||||
// callback functions or other non-serializable options
|
||||
customFn: (data) => {
|
||||
// ...
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
Options set via `quartz.ts` are merged with YAML options at instantiation time, with `quartz.ts` overrides taking precedence.
|
||||
Options set via `quartz.ts` are merged with YAML options at instantiation time, with `quartz.ts` overrides taking precedence. These calls must be placed **before** `loadQuartzConfig()` in your `quartz.ts`.
|
||||
|
||||
### Development Workflow
|
||||
|
||||
|
||||
Reference in New Issue
Block a user