-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplugins.ts
33 lines (28 loc) · 912 Bytes
/
plugins.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
33
import lightningcss from "lume/plugins/lightningcss.ts";
import basePath from "lume/plugins/base_path.ts";
import metas from "lume/plugins/metas.ts";
import { Options as SitemapOptions, sitemap } from "lume/plugins/sitemap.ts";
import { favicon, Options as FaviconOptions } from "lume/plugins/favicon.ts";
import { merge } from "lume/core/utils/object.ts";
import "lume/types.ts";
export interface Options {
sitemap?: Partial<SitemapOptions>;
favicon?: Partial<FaviconOptions>;
}
export const defaults: Options = {
favicon: {
input: "uploads/favicon.svg",
},
};
/** Configure the site */
export default function (userOptions?: Options) {
const options = merge(defaults, userOptions);
return (site: Lume.Site) => {
site.use(lightningcss())
.use(basePath())
.use(metas())
.use(sitemap(options.sitemap))
.use(favicon(options.favicon))
.copy("uploads");
};
}