From 5a39719898fe486994750ec24fa430f332fa67eb Mon Sep 17 00:00:00 2001
From: Aaron Pham <contact@aarnphm.xyz>
Date: Thu, 06 Mar 2025 01:33:16 +0000
Subject: [PATCH] fix(graph): set container as renderGroup to avoid redrawing multiple times (#1736)
---
quartz/plugins/types.ts | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/quartz/plugins/types.ts b/quartz/plugins/types.ts
index 2662aed..667799f 100644
--- a/quartz/plugins/types.ts
+++ b/quartz/plugins/types.ts
@@ -1,9 +1,10 @@
import { PluggableList } from "unified"
-import { StaticResources } from "../resources"
+import { StaticResources } from "../util/resources"
import { ProcessedContent } from "./vfile"
import { QuartzComponent } from "../components/types"
-import { FilePath, ServerSlug } from "../path"
-import { BuildCtx } from "../ctx"
+import { FilePath } from "../util/path"
+import { BuildCtx } from "../util/ctx"
+import DepGraph from "../depgraph"
export interface PluginTypes {
transformers: QuartzTransformerPluginInstance[]
@@ -17,7 +18,7 @@
) => QuartzTransformerPluginInstance
export type QuartzTransformerPluginInstance = {
name: string
- textTransform?: (ctx: BuildCtx, src: string | Buffer) => string | Buffer
+ textTransform?: (ctx: BuildCtx, src: string) => string
markdownPlugins?: (ctx: BuildCtx) => PluggableList
htmlPlugins?: (ctx: BuildCtx) => PluggableList
externalResources?: (ctx: BuildCtx) => Partial<StaticResources>
@@ -36,19 +37,11 @@
) => QuartzEmitterPluginInstance
export type QuartzEmitterPluginInstance = {
name: string
- emit(
+ emit(ctx: BuildCtx, content: ProcessedContent[], resources: StaticResources): Promise<FilePath[]>
+ getQuartzComponents(ctx: BuildCtx): QuartzComponent[]
+ getDependencyGraph?(
ctx: BuildCtx,
content: ProcessedContent[],
resources: StaticResources,
- emitCallback: EmitCallback,
- ): Promise<FilePath[]>
- getQuartzComponents(ctx: BuildCtx): QuartzComponent[]
+ ): Promise<DepGraph<FilePath>>
}
-
-export interface EmitOptions {
- slug: ServerSlug
- ext: `.${string}` | ""
- content: string
-}
-
-export type EmitCallback = (data: EmitOptions) => Promise<FilePath>
--
Gitblit v1.10.0