-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_config.ts
75 lines (59 loc) · 1.73 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import lume from "lume/mod.ts";
import codeHighlight from "lume/plugins/code_highlight.ts";
import esbuild from "lume/plugins/esbuild.ts";
import feed from "lume/plugins/feed.ts";
import jsx from "lume/plugins/jsx.ts";
import minifyHTML from "lume/plugins/minify_html.ts";
import sitemap from "lume/plugins/sitemap.ts";
const site = lume({
src: "./site",
});
site.use(codeHighlight());
site.use(esbuild());
site.use(jsx());
site.use(minifyHTML());
site.process([".html"], (pages) => {
pages.forEach((page) => {
const document = page.document!;
document.querySelectorAll("table").forEach((table) => {
const div = document.createElement("div");
table.classList.add("rotated");
div.classList.add("overflow", "rotated");
table.parentNode!.insertBefore(div, table);
div.appendChild(table);
});
document.querySelectorAll(".hljs").forEach((code) => {
const pre = code.parentElement!;
const div = document.createElement("div");
code.classList.add("rotated");
pre.classList.add("rotated");
div.classList.add("overflow", "rotated");
pre.parentNode?.insertBefore(div, pre);
div.appendChild(pre);
});
});
});
site.use(feed({
output: ["/blog.rss", "/blog.json"],
query: "type=article",
sort: "date=asc",
limit: Infinity,
info: {
title: "RGBCube's Blog",
description:
"The blog where RGBCube dumps his schizophrenic ramblings about software and all the likes.",
generator: false,
},
items: {
title: "=title",
description: "=description",
published: "=date",
content: "$.content",
},
}));
site.use(sitemap({
// @ts-ignore: We don't want lastmods.
lastmod: null,
}));
site.copyRemainingFiles();
export default site;