deno.land / x / lume@v2.1.4 / plugins / yaml.ts
12345678910111213141516171819202122232425262728293031import yaml from "../core/loaders/yaml.ts";import { merge } from "../core/utils/object.ts";
import type Site from "../core/site.ts";
export interface Options { /** The list of extensions this plugin applies to */ extensions?: string[];
/** Optional sub-extension for page files */ pageSubExtension?: string;}
// Default optionsexport const defaults: Options = { extensions: [".yaml", ".yml"],};
/** A plugin to add support for YAML files */export default function (userOptions?: Options) { const options = merge(defaults, userOptions);
return (site: Site) => { site.loadData(options.extensions, yaml); site.loadPages(options.extensions, { loader: yaml, pageSubExtension: options.pageSubExtension, }); };}
Version Info