Skip to main content

category

beforeGenerateIndexMetafileHook()​

function beforeGenerateIndexMetafileHook(event): Promise<void>;

Defined in: docusaurus/src/mdx/category.ts:27

Hook that materializes a _category_.yml file before Docusaurus indexes a directory, ensuring generated bundles have labels, ordering, and optional generated-index metadata even when the folder was produced by the CLI.

Parameters​

event​

Hook payload containing the target directory, category name, and generator options.

data​

{ category: string; dirPath: string; options?: Record<string, unknown>; outputAdapter?: OutputAdapter; }

data.category​

string

data.dirPath​

string

data.options?​

Record<string, unknown>

data.outputAdapter?​

OutputAdapter

Returns​

Promise<void>