deno.land / x / lume@v2.1.4 / mod.ts
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263import Site from "./core/site.ts";import url, { Options as UrlOptions } from "./plugins/url.ts";import json, { Options as JsonOptions } from "./plugins/json.ts";import markdown, { Options as MarkdownOptions } from "./plugins/markdown.ts";import modules, { Options as ModulesOptions } from "./plugins/modules.ts";import vento, { Options as VentoOptions } from "./plugins/vento.ts";import search, { Options as SearchOptions } from "./plugins/search.ts";import paginate, { Options as PaginateOptions } from "./plugins/paginate.ts";import toml, { Options as TomlOptions } from "./plugins/toml.ts";import yaml, { Options as YamlOptions } from "./plugins/yaml.ts";import { merge } from "./core/utils/object.ts";
import type { DeepPartial } from "./core/utils/object.ts";import type { SiteOptions } from "./core/site.ts";import { getOptionsFromCli } from "./core/utils/cli_options.ts";
export interface PluginOptions { url?: UrlOptions; json?: JsonOptions; markdown?: MarkdownOptions; modules?: ModulesOptions; vento?: VentoOptions; search?: SearchOptions; paginate?: PaginateOptions; toml?: TomlOptions; yaml?: YamlOptions;}
export default function lume( options: DeepPartial<SiteOptions> = {}, pluginOptions: PluginOptions = {}, cliOptions = true,): Site { if (cliOptions) { options = merge(options, getOptionsFromCli()); }
const site = new Site(options as Partial<SiteOptions>);
// Ignore some files by the watcher site.options.watcher.ignore.push("/deno.lock"); site.options.watcher.ignore.push("/node_modules/.deno"); site.options.watcher.ignore.push("/.git"); site.options.watcher.ignore.push((path) => path.endsWith("/.DS_Store"));
return site .ignore("node_modules") .ignore("import_map.json") .ignore("deno.json") .ignore("deno.jsonc") .ignore("deno.lock") .mergeKey("tags", "stringArray") .use(url(pluginOptions.url)) .use(json(pluginOptions.json)) .use(markdown(pluginOptions.markdown)) .use(modules(pluginOptions.modules)) .use(vento(pluginOptions.vento)) .use(paginate(pluginOptions.paginate)) .use(search(pluginOptions.search)) .use(toml(pluginOptions.toml)) .use(yaml(pluginOptions.yaml));}
Version Info