From aaa5c8e8e40be33aec74c1cf0073ac081cb918fc Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Mon, 24 Mar 2025 00:34:14 +0000
Subject: [PATCH] feat: conditional render component

---
 quartz/plugins/emitters/cname.ts |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/quartz/plugins/emitters/cname.ts b/quartz/plugins/emitters/cname.ts
index cbed2a8..10781db 100644
--- a/quartz/plugins/emitters/cname.ts
+++ b/quartz/plugins/emitters/cname.ts
@@ -2,7 +2,6 @@
 import { QuartzEmitterPlugin } from "../types"
 import fs from "fs"
 import chalk from "chalk"
-import DepGraph from "../../depgraph"
 
 export function extractDomainFromBaseUrl(baseUrl: string) {
   const url = new URL(`https://${baseUrl}`)
@@ -11,13 +10,7 @@
 
 export const CNAME: QuartzEmitterPlugin = () => ({
   name: "CNAME",
-  getQuartzComponents() {
-    return []
-  },
-  async getDependencyGraph(_ctx, _content, _resources) {
-    return new DepGraph<FilePath>()
-  },
-  async emit({ argv, cfg }, _content, _resources): Promise<FilePath[]> {
+  async emit({ argv, cfg }) {
     if (!cfg.configuration.baseUrl) {
       console.warn(chalk.yellow("CNAME emitter requires `baseUrl` to be set in your configuration"))
       return []
@@ -27,7 +20,8 @@
     if (!content) {
       return []
     }
-    fs.writeFileSync(path, content)
+    await fs.promises.writeFile(path, content)
     return [path] as FilePath[]
   },
+  async *partialEmit() {},
 })

--
Gitblit v1.10.0