UNPKG

@mdfriday/foundry

Version:

The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.

45 lines 1.33 kB
import { TemplateInfo as ITemplateInfo, TemplateError, TemplateType } from '../type'; import { FileMetaInfo } from '../../fs/type'; export declare class TemplateInfo implements ITemplateInfo { name: string; template: string; fi: FileMetaInfo; constructor(name: string, template: string, fi: FileMetaInfo); /** * Get identifier base */ identifierBase(): string; /** * Create error with file context */ errWithFileContext(what: string, err: Error): TemplateError; /** * Check if template info is zero value */ isZero(): boolean; /** * Create a copy of this template info */ copy(): TemplateInfo; /** * Get template content without BOM */ getCleanContent(): string; } /** * Load template from file meta info */ export declare function loadTemplate(name: string, fim: FileMetaInfo): Promise<TemplateInfo>; /** * Resolve template type based on template name * @param name - Template name/path * @returns Template type */ export declare function resolveTemplateType(name: string): TemplateType; /** * Check if template name indicates a shortcode * @param name - Template name/path * @returns true if it's a shortcode template */ export declare function isShortcode(name: string): boolean; //# sourceMappingURL=info.d.ts.map