deno.land / x / lume@v2.1.4 / plugins / json.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import json from "../core/loaders/json.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: [".json", ".jsonc"], pageSubExtension: ".page",};
/** A plugin to add support for JSON files */export default function (userOptions?: Options) { const options = merge(defaults, userOptions);
return (site: Site) => { site.loadData(options.extensions, json); site.loadPages(options.extensions, { pageSubExtension: options.pageSubExtension, loader: json, }); };}
lume

Version Info

Tagged at
7 months ago