Jacky Zhao
2025-03-16 a7372079817fb1a1e69b2632405d759f9c5e913d
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,10 +10,7 @@
export const CNAME: QuartzEmitterPlugin = () => ({
  name: "CNAME",
  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 []
@@ -24,7 +20,8 @@
    if (!content) {
      return []
    }
    fs.writeFileSync(path, content)
    await fs.promises.writeFile(path, content)
    return [path] as FilePath[]
  },
  async *partialEmit() {},
})