generated from open-innovations/oi-lume-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_config.ts
55 lines (42 loc) · 1.71 KB
/
_config.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import lume from "lume/mod.ts";
import nunjucks from "lume/plugins/nunjucks.ts"; // Lume 2.0 requires us to add Nunjucks
import base_path from "lume/plugins/base_path.ts";
import date from "lume/plugins/date.ts";
import metas from "lume/plugins/metas.ts";
import postcss from "lume/plugins/postcss.ts";
// Importing the OI Lume charts and utilities
import oiViz from "https://deno.land/x/[email protected]/mod.ts";
import autoDependency from "https://deno.land/x/[email protected]/processors/auto-dependency.ts";
import csvLoader from "https://deno.land/x/[email protected]/loaders/csv-loader.ts";
import jsonLoader from "lume/core/loaders/json.ts";
const site = lume({
src: './src',
// TODO Update this with the proper URL
location: new URL("https://open-innovations.github.io/true-north/"),
});
// Need to explicitly include it for Lume 2
site.use(nunjucks());
// The autodependency processor needs to be registered before the base path plugin,
// or else the autodepended paths will not be rewritten to include the path prefix
// set in location passed to the lume constructor (above)
site.process([".html"], (pages) => pages.forEach(autoDependency));
site.loadData([".csv", ".tsv", ".dat"], csvLoader({ basic: true }));
site.loadData([".geojson"], jsonLoader);
site.loadData([".hexjson"], jsonLoader);
// Import lume viz
import oiVizConfig from "./oi-viz-config.ts";
site.use(oiViz(oiVizConfig));
site.use(base_path());
site.use(metas({
defaultPageData: {
title: 'title', // Use the `date` value as fallback.
},
}));
site.use(date());
site.use(postcss({}));
site.copy('CNAME');
site.copy('.nojekyll');
site.copy('assets/images');
site.copy('assets/css/fonts');
site.copy('assets/js');
export default site;