Aaron Pham
2024-02-23 345c347a56070d0b0d2b72656df891eec6a1f7ab
chore: passing additional buildCtx to componentData (#914)

Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
5 files modified
6 ■■■■■ changed files
quartz/components/types.ts 2 ●●●●● patch | view | raw | blame | history
quartz/plugins/emitters/404.tsx 1 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/contentPage.tsx 1 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/folderPage.tsx 1 ●●●● patch | view | raw | blame | history
quartz/plugins/emitters/tagPage.tsx 1 ●●●● patch | view | raw | blame | history
quartz/components/types.ts
@@ -3,8 +3,10 @@
import { QuartzPluginData } from "../plugins/vfile"
import { GlobalConfiguration } from "../cfg"
import { Node } from "hast"
import { BuildCtx } from "../util/ctx"
export type QuartzComponentProps = {
  ctx: BuildCtx
  externalResources: StaticResources
  fileData: QuartzPluginData
  cfg: GlobalConfiguration
quartz/plugins/emitters/404.tsx
@@ -46,6 +46,7 @@
        frontmatter: { title: notFound, tags: [] },
      })
      const componentData: QuartzComponentProps = {
        ctx,
        fileData: vfile.data,
        externalResources,
        cfg,
quartz/plugins/emitters/contentPage.tsx
@@ -97,6 +97,7 @@
        const externalResources = pageResources(pathToRoot(slug), resources)
        const componentData: QuartzComponentProps = {
          ctx,
          fileData: file.data,
          externalResources,
          cfg,
quartz/plugins/emitters/folderPage.tsx
@@ -95,6 +95,7 @@
        const externalResources = pageResources(pathToRoot(slug), resources)
        const [tree, file] = folderDescriptions[folder]
        const componentData: QuartzComponentProps = {
          ctx,
          fileData: file.data,
          externalResources,
          cfg,
quartz/plugins/emitters/tagPage.tsx
@@ -99,6 +99,7 @@
        const externalResources = pageResources(pathToRoot(slug), resources)
        const [tree, file] = tagDescriptions[tag]
        const componentData: QuartzComponentProps = {
          ctx,
          fileData: file.data,
          externalResources,
          cfg,