mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-21 21:45:42 -05:00
chore: format
This commit is contained in:
parent
472b337d92
commit
8f58a5a599
@ -286,8 +286,7 @@ export async function loadQuartzConfig(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const gitSpec = parsePluginSource(entry.source)
|
const gitSpec = parsePluginSource(entry.source)
|
||||||
const isComponentOnly =
|
const isComponentOnly = categories.length > 0 && categories.every((c) => c === "component")
|
||||||
categories.length > 0 && categories.every((c) => c === "component")
|
|
||||||
|
|
||||||
if (isComponentOnly) {
|
if (isComponentOnly) {
|
||||||
// Always import the main entry point for component-only plugins.
|
// Always import the main entry point for component-only plugins.
|
||||||
|
|||||||
@ -207,7 +207,16 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
|
|||||||
for (const pt of pageTypes) {
|
for (const pt of pageTypes) {
|
||||||
if (pt.match({ slug, fileData, cfg })) {
|
if (pt.match({ slug, fileData, cfg })) {
|
||||||
const layout = resolveLayout(pt, defaults, byPageType)
|
const layout = resolveLayout(pt, defaults, byPageType)
|
||||||
yield emitPage(ctx, slug, tree, fileData, allFilesWithVirtual, layout, resources, treeTransforms)
|
yield emitPage(
|
||||||
|
ctx,
|
||||||
|
slug,
|
||||||
|
tree,
|
||||||
|
fileData,
|
||||||
|
allFilesWithVirtual,
|
||||||
|
layout,
|
||||||
|
resources,
|
||||||
|
treeTransforms,
|
||||||
|
)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -290,7 +299,16 @@ export const PageTypeDispatcher: QuartzEmitterPlugin<Partial<DispatcherOptions>>
|
|||||||
for (const pt of pageTypes) {
|
for (const pt of pageTypes) {
|
||||||
if (pt.match({ slug, fileData, cfg })) {
|
if (pt.match({ slug, fileData, cfg })) {
|
||||||
const layout = resolveLayout(pt, defaults, byPageType)
|
const layout = resolveLayout(pt, defaults, byPageType)
|
||||||
yield emitPage(ctx, slug, tree, fileData, allFilesWithVirtual, layout, resources, treeTransforms)
|
yield emitPage(
|
||||||
|
ctx,
|
||||||
|
slug,
|
||||||
|
tree,
|
||||||
|
fileData,
|
||||||
|
allFilesWithVirtual,
|
||||||
|
layout,
|
||||||
|
resources,
|
||||||
|
treeTransforms,
|
||||||
|
)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
import { PluggableList } from "unified"
|
import { PluggableList } from "unified"
|
||||||
import { StaticResources } from "../util/resources"
|
import { StaticResources } from "../util/resources"
|
||||||
import { ProcessedContent, QuartzPluginData } from "./vfile"
|
import { ProcessedContent, QuartzPluginData } from "./vfile"
|
||||||
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../components/types"
|
import {
|
||||||
|
QuartzComponent,
|
||||||
|
QuartzComponentConstructor,
|
||||||
|
QuartzComponentProps,
|
||||||
|
} from "../components/types"
|
||||||
import { FilePath, FullSlug } from "../util/path"
|
import { FilePath, FullSlug } from "../util/path"
|
||||||
import { BuildCtx } from "../util/ctx"
|
import { BuildCtx } from "../util/ctx"
|
||||||
import { GlobalConfiguration } from "../cfg"
|
import { GlobalConfiguration } from "../cfg"
|
||||||
@ -92,7 +96,11 @@ export type PageGenerator = (args: {
|
|||||||
}) => VirtualPage[]
|
}) => VirtualPage[]
|
||||||
|
|
||||||
/** A function that mutates a HAST tree at render time, when allFiles is available. */
|
/** A function that mutates a HAST tree at render time, when allFiles is available. */
|
||||||
export type TreeTransform = (root: Root, slug: FullSlug, componentData: QuartzComponentProps) => void
|
export type TreeTransform = (
|
||||||
|
root: Root,
|
||||||
|
slug: FullSlug,
|
||||||
|
componentData: QuartzComponentProps,
|
||||||
|
) => void
|
||||||
|
|
||||||
export type QuartzPageTypePlugin<Options extends OptionType = undefined> = (
|
export type QuartzPageTypePlugin<Options extends OptionType = undefined> = (
|
||||||
opts?: Options,
|
opts?: Options,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user