chore: passing additional buildCtx to componentData (#914)
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
		@@ -3,8 +3,10 @@ import { StaticResources } from "../util/resources"
 | 
				
			|||||||
import { QuartzPluginData } from "../plugins/vfile"
 | 
					import { QuartzPluginData } from "../plugins/vfile"
 | 
				
			||||||
import { GlobalConfiguration } from "../cfg"
 | 
					import { GlobalConfiguration } from "../cfg"
 | 
				
			||||||
import { Node } from "hast"
 | 
					import { Node } from "hast"
 | 
				
			||||||
 | 
					import { BuildCtx } from "../util/ctx"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type QuartzComponentProps = {
 | 
					export type QuartzComponentProps = {
 | 
				
			||||||
 | 
					  ctx: BuildCtx
 | 
				
			||||||
  externalResources: StaticResources
 | 
					  externalResources: StaticResources
 | 
				
			||||||
  fileData: QuartzPluginData
 | 
					  fileData: QuartzPluginData
 | 
				
			||||||
  cfg: GlobalConfiguration
 | 
					  cfg: GlobalConfiguration
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -46,6 +46,7 @@ export const NotFoundPage: QuartzEmitterPlugin = () => {
 | 
				
			|||||||
        frontmatter: { title: notFound, tags: [] },
 | 
					        frontmatter: { title: notFound, tags: [] },
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      const componentData: QuartzComponentProps = {
 | 
					      const componentData: QuartzComponentProps = {
 | 
				
			||||||
 | 
					        ctx,
 | 
				
			||||||
        fileData: vfile.data,
 | 
					        fileData: vfile.data,
 | 
				
			||||||
        externalResources,
 | 
					        externalResources,
 | 
				
			||||||
        cfg,
 | 
					        cfg,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,6 +97,7 @@ export const ContentPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOp
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
					        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
				
			||||||
        const componentData: QuartzComponentProps = {
 | 
					        const componentData: QuartzComponentProps = {
 | 
				
			||||||
 | 
					          ctx,
 | 
				
			||||||
          fileData: file.data,
 | 
					          fileData: file.data,
 | 
				
			||||||
          externalResources,
 | 
					          externalResources,
 | 
				
			||||||
          cfg,
 | 
					          cfg,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,6 +95,7 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpt
 | 
				
			|||||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
					        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
				
			||||||
        const [tree, file] = folderDescriptions[folder]
 | 
					        const [tree, file] = folderDescriptions[folder]
 | 
				
			||||||
        const componentData: QuartzComponentProps = {
 | 
					        const componentData: QuartzComponentProps = {
 | 
				
			||||||
 | 
					          ctx,
 | 
				
			||||||
          fileData: file.data,
 | 
					          fileData: file.data,
 | 
				
			||||||
          externalResources,
 | 
					          externalResources,
 | 
				
			||||||
          cfg,
 | 
					          cfg,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -99,6 +99,7 @@ export const TagPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpts)
 | 
				
			|||||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
					        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
				
			||||||
        const [tree, file] = tagDescriptions[tag]
 | 
					        const [tree, file] = tagDescriptions[tag]
 | 
				
			||||||
        const componentData: QuartzComponentProps = {
 | 
					        const componentData: QuartzComponentProps = {
 | 
				
			||||||
 | 
					          ctx,
 | 
				
			||||||
          fileData: file.data,
 | 
					          fileData: file.data,
 | 
				
			||||||
          externalResources,
 | 
					          externalResources,
 | 
				
			||||||
          cfg,
 | 
					          cfg,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user