| | |
| | | import { GlobalConfiguration } from "../../cfg" |
| | | import { CanonicalSlug, ClientSlug, FilePath, ServerSlug, canonicalizeServer } from "../../path" |
| | | import { |
| | | CanonicalSlug, |
| | | ClientSlug, |
| | | FilePath, |
| | | ServerSlug, |
| | | canonicalizeServer, |
| | | } from "../../util/path" |
| | | import { QuartzEmitterPlugin } from "../types" |
| | | import path from "path" |
| | | |
| | |
| | | } |
| | | |
| | | if (opts?.enableSiteMap) { |
| | | await emit({ |
| | | content: generateSiteMap(cfg, linkIndex), |
| | | slug: "sitemap" as ServerSlug, |
| | | ext: ".xml", |
| | | }) |
| | | emitted.push("sitemap.xml" as FilePath) |
| | | emitted.push( |
| | | await emit({ |
| | | content: generateSiteMap(cfg, linkIndex), |
| | | slug: "sitemap" as ServerSlug, |
| | | ext: ".xml", |
| | | }), |
| | | ) |
| | | } |
| | | |
| | | if (opts?.enableRSS) { |
| | | await emit({ |
| | | content: generateRSSFeed(cfg, linkIndex), |
| | | slug: "index" as ServerSlug, |
| | | ext: ".xml", |
| | | }) |
| | | emitted.push("index.xml" as FilePath) |
| | | emitted.push( |
| | | await emit({ |
| | | content: generateRSSFeed(cfg, linkIndex), |
| | | slug: "index" as ServerSlug, |
| | | ext: ".xml", |
| | | }), |
| | | ) |
| | | } |
| | | |
| | | const fp = path.join("static", "contentIndex") as ServerSlug |
| | |
| | | }), |
| | | ) |
| | | |
| | | await emit({ |
| | | content: JSON.stringify(simplifiedIndex), |
| | | slug: fp, |
| | | ext: ".json", |
| | | }) |
| | | emitted.push(`${fp}.json` as FilePath) |
| | | emitted.push( |
| | | await emit({ |
| | | content: JSON.stringify(simplifiedIndex), |
| | | slug: fp, |
| | | ext: ".json", |
| | | }), |
| | | ) |
| | | |
| | | return emitted |
| | | }, |