Jacky Zhao
2023-06-17 917d5791acd6361c691902b445bdc4f7129ba3fc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { QuartzEmitterPlugin } from "../types"
 
interface Options {
  domain: string
}
 
export const CNAME: QuartzEmitterPlugin<Options> = (opts?: Options) => ({
  name: "CNAME",
  getQuartzComponents() {
    return []
  },
  async emit(_contentFolder, _cfg, _content, _resources, emit): Promise<string[]> {
    const slug = "CNAME"
 
    if (opts?.domain) {
      await emit({
        content: opts?.domain,
        slug,
        ext: "",
      })
    }
 
    return ["CNAME"]
  }
})