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:
@@ -51,6 +51,7 @@ For custom view renderers, use a TS override in `quartz.ts`:
|
||||
```ts title="quartz.ts (override)"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.BasesPage({
|
||||
defaultViewType: "table",
|
||||
customViews: {
|
||||
|
||||
@@ -43,12 +43,13 @@ For the TS override approach (needed for custom `imageStructure`):
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
import { defaultImage } from "./quartz/plugins/emitters/ogImage"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.CustomOgImages({
|
||||
colorScheme: "lightMode",
|
||||
width: 1200,
|
||||
height: 630,
|
||||
excludeRoot: false,
|
||||
imageStructure: defaultImage, // custom JSX component — requires TS
|
||||
imageStructure: defaultImage,
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ This plugin accepts the following configuration options:
|
||||
```ts title="quartz.ts"
|
||||
import * as ExternalPlugin from "./.quartz/plugins"
|
||||
|
||||
// Must be placed before loadQuartzConfig()
|
||||
ExternalPlugin.Explorer({
|
||||
mapFn: (node) => {
|
||||
node.displayName = node.displayName.toUpperCase()
|
||||
|
||||
Reference in New Issue
Block a user