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 |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/quartz/plugins/emitters/cname.ts b/quartz/plugins/emitters/cname.ts
index 3e17fea..10781db 100644
--- a/quartz/plugins/emitters/cname.ts
+++ b/quartz/plugins/emitters/cname.ts
@@ -10,10 +10,7 @@
 
 export const CNAME: QuartzEmitterPlugin = () => ({
   name: "CNAME",
-  getQuartzComponents() {
-    return []
-  },
-  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 []
@@ -23,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