From 345c347a56070d0b0d2b72656df891eec6a1f7ab Mon Sep 17 00:00:00 2001 From: Aaron Pham <29749331+aarnphm@users.noreply.github.com> Date: Thu, 22 Feb 2024 20:51:07 -0500 Subject: [PATCH] chore: passing additional buildCtx to componentData (#914) Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com> --- quartz/components/types.ts | 2 ++ quartz/plugins/emitters/404.tsx | 1 + quartz/plugins/emitters/contentPage.tsx | 1 + quartz/plugins/emitters/folderPage.tsx | 1 + quartz/plugins/emitters/tagPage.tsx | 1 + 5 files changed, 6 insertions(+) diff --git a/quartz/components/types.ts b/quartz/components/types.ts index d322ea9..a6b90d3 100644 --- a/quartz/components/types.ts +++ b/quartz/components/types.ts @@ -3,8 +3,10 @@ import { StaticResources } from "../util/resources" 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 diff --git a/quartz/plugins/emitters/404.tsx b/quartz/plugins/emitters/404.tsx index f9d7a86..e4605cf 100644 --- a/quartz/plugins/emitters/404.tsx +++ b/quartz/plugins/emitters/404.tsx @@ -46,6 +46,7 @@ export const NotFoundPage: QuartzEmitterPlugin = () => { frontmatter: { title: notFound, tags: [] }, }) const componentData: QuartzComponentProps = { + ctx, fileData: vfile.data, externalResources, cfg, diff --git a/quartz/plugins/emitters/contentPage.tsx b/quartz/plugins/emitters/contentPage.tsx index 904a8a8..f493802 100644 --- a/quartz/plugins/emitters/contentPage.tsx +++ b/quartz/plugins/emitters/contentPage.tsx @@ -97,6 +97,7 @@ export const ContentPage: QuartzEmitterPlugin> = (userOp const externalResources = pageResources(pathToRoot(slug), resources) const componentData: QuartzComponentProps = { + ctx, fileData: file.data, externalResources, cfg, diff --git a/quartz/plugins/emitters/folderPage.tsx b/quartz/plugins/emitters/folderPage.tsx index bf69d29..d892b28 100644 --- a/quartz/plugins/emitters/folderPage.tsx +++ b/quartz/plugins/emitters/folderPage.tsx @@ -95,6 +95,7 @@ export const FolderPage: QuartzEmitterPlugin> = (userOpt const externalResources = pageResources(pathToRoot(slug), resources) const [tree, file] = folderDescriptions[folder] const componentData: QuartzComponentProps = { + ctx, fileData: file.data, externalResources, cfg, diff --git a/quartz/plugins/emitters/tagPage.tsx b/quartz/plugins/emitters/tagPage.tsx index 3eb6975..6f65ae4 100644 --- a/quartz/plugins/emitters/tagPage.tsx +++ b/quartz/plugins/emitters/tagPage.tsx @@ -99,6 +99,7 @@ export const TagPage: QuartzEmitterPlugin> = (userOpts) const externalResources = pageResources(pathToRoot(slug), resources) const [tree, file] = tagDescriptions[tag] const componentData: QuartzComponentProps = { + ctx, fileData: file.data, externalResources, cfg,