This repository has been archived by the owner on Nov 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
/
_config.ts
58 lines (50 loc) · 1.56 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
56
57
58
import lume from "lume/mod.ts";
import codeHighlight from "lume/plugins/code_highlight.ts";
import postcss from "lume/plugins/postcss.ts";
import basePath from "lume/plugins/base_path.ts";
import resolveUrls from "lume/plugins/resolve_urls.ts";
import anchor from "https://jspm.dev/[email protected]";
import gpm from "https://deno.land/x/[email protected]/mod.ts";
import psyche from "https://deno.land/x/[email protected]/indexers/lume.ts";
const markdown = {
plugins: [
// @ts-ignore: no anchor typings
[anchor, { permalink: anchor.permalink.headerLink() }],
],
keepDefaultPlugins: true,
};
const site = lume(
{ location: new URL("https://lumeland.github.io") },
{ markdown },
);
// Fetch the last lume version
const response = await fetch("https://cdn.deno.land/lume/meta/versions.json");
const versions = await response.json();
site.data("lastVersion", versions.latest);
site.ignore("README.md");
site.copy("js");
site.copy("logo.svg");
site.copy("deno.svg");
site.copy("lume.png");
site.copy("favicon.ico");
site.copy("favicon-32x32.png");
site.copy("img");
site.use(postcss());
site.use(codeHighlight());
site.use(resolveUrls());
site.use(basePath());
site.use(psyche({ selector: ".article-content" }));
// Insert the link to edit the original .md page
site.preprocess([".html"], (page) => {
page.data.sourceFile = page.src.path + page.src.ext;
});
// Download browser dependencies
site.addEventListener("beforeBuild", () => {
return gpm([
{
name: "oom-components/page-loader",
files: ["src"],
},
], "js/vendor");
});
export default site;