Jacky Zhao
2023-07-20 76c092dcf20959bc52fcb13b28cee50cd4217e40
quartz/plugins/emitters/contentPage.tsx
@@ -4,6 +4,7 @@
import BodyConstructor from "../../components/Body"
import { pageResources, renderPage } from "../../components/renderPage"
import { FullPageLayout } from "../../cfg"
import { FilePath, canonicalizeServer } from "../../path"
export const ContentPage: QuartzEmitterPlugin<FullPageLayout> = (opts) => {
  if (!opts) {
@@ -19,11 +20,11 @@
    getQuartzComponents() {
      return [Head, Header, Body, ...header, ...beforeBody, Content, ...left, ...right, Footer]
    },
    async emit(_contentDir, cfg, content, resources, emit): Promise<string[]> {
      const fps: string[] = []
    async emit(_contentDir, cfg, content, resources, emit): Promise<FilePath[]> {
      const fps: FilePath[] = []
      const allFiles = content.map(c => c[1].data)
      for (const [tree, file] of content) {
        const slug = file.data.slug!
        const slug = canonicalizeServer(file.data.slug!)
        const externalResources = pageResources(slug, resources)
        const componentData: QuartzComponentProps = {
          fileData: file.data,
@@ -41,7 +42,7 @@
          externalResources
        )
        const fp = file.data.slug + ".html"
        const fp = file.data.slug + ".html" as FilePath
        await emit({
          content,
          slug: file.data.slug!,