Interface ProcessTemplateFileConfig

Configuration object for the template() function.

interface ProcessTemplateFileConfig {
    baseDir?: string;
    filters?: Map<string, Function>;
    includeDir?: string;
    layoutDir?: string;
    parentIncludes?: string[];
    parentLayouts?: string[];
    preprocessors?: Preprocessor[];
    relativeIncludes?: boolean;
    resolve?: (file: string) => Promise<string | Buffer>;
}

Properties

baseDir?: string

base directory. default: "."

filters?: Map<string, Function>

map of additional filters to be used in the template

includeDir?: string

subdirectory to look for html partials. default: "_includes"

layoutDir?: string

subdirectory to look for layout files. default: "_layouts"

parentIncludes?: string[]

array of parent includes. Internally used to detect cyclic dependencies

parentLayouts?: string[]

array of parent layouts. Internally used to detect cyclic dependencies

preprocessors?: Preprocessor[]

list of preprocessors. By default: built-ins for html, css, markdown

relativeIncludes?: boolean

whether to include relative to the current file. default: false

resolve?: (file: string) => Promise<string | Buffer>

optional resolver function (defaults to node readFile)