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 { GlobalConfiguration } from "../cfg"
 | 
			
		||||
import { Node } from "hast"
 | 
			
		||||
import { BuildCtx } from "../util/ctx"
 | 
			
		||||
 | 
			
		||||
export type QuartzComponentProps = {
 | 
			
		||||
  ctx: BuildCtx
 | 
			
		||||
  externalResources: StaticResources
 | 
			
		||||
  fileData: QuartzPluginData
 | 
			
		||||
  cfg: GlobalConfiguration
 | 
			
		||||
 
 | 
			
		||||
@@ -46,6 +46,7 @@ export const NotFoundPage: QuartzEmitterPlugin = () => {
 | 
			
		||||
        frontmatter: { title: notFound, tags: [] },
 | 
			
		||||
      })
 | 
			
		||||
      const componentData: QuartzComponentProps = {
 | 
			
		||||
        ctx,
 | 
			
		||||
        fileData: vfile.data,
 | 
			
		||||
        externalResources,
 | 
			
		||||
        cfg,
 | 
			
		||||
 
 | 
			
		||||
@@ -97,6 +97,7 @@ export const ContentPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOp
 | 
			
		||||
 | 
			
		||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
			
		||||
        const componentData: QuartzComponentProps = {
 | 
			
		||||
          ctx,
 | 
			
		||||
          fileData: file.data,
 | 
			
		||||
          externalResources,
 | 
			
		||||
          cfg,
 | 
			
		||||
 
 | 
			
		||||
@@ -95,6 +95,7 @@ export const FolderPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpt
 | 
			
		||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
			
		||||
        const [tree, file] = folderDescriptions[folder]
 | 
			
		||||
        const componentData: QuartzComponentProps = {
 | 
			
		||||
          ctx,
 | 
			
		||||
          fileData: file.data,
 | 
			
		||||
          externalResources,
 | 
			
		||||
          cfg,
 | 
			
		||||
 
 | 
			
		||||
@@ -99,6 +99,7 @@ export const TagPage: QuartzEmitterPlugin<Partial<FullPageLayout>> = (userOpts)
 | 
			
		||||
        const externalResources = pageResources(pathToRoot(slug), resources)
 | 
			
		||||
        const [tree, file] = tagDescriptions[tag]
 | 
			
		||||
        const componentData: QuartzComponentProps = {
 | 
			
		||||
          ctx,
 | 
			
		||||
          fileData: file.data,
 | 
			
		||||
          externalResources,
 | 
			
		||||
          cfg,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user