-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path_config.ts
More file actions
98 lines (88 loc) · 2.28 KB
/
_config.ts
File metadata and controls
98 lines (88 loc) · 2.28 KB
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import lume from "lume/mod.ts";
import date from "lume/plugins/date.ts";
import esbuild from "lume/plugins/esbuild.ts";
import jsx_preact from "lume/plugins/jsx_preact.ts";
import feed from "lume/plugins/feed.ts";
import reading_info from "lume/plugins/reading_info.ts";
import vento from "lume/plugins/vento.ts";
import rehypePrettyCode from "npm:rehype-pretty-code";
import prettier from "npm:prettier"
import remark from "./remark.ts";
import { fnv_1a } from "./utils.ts"
const site = lume({
location: new URL("https://utf9k.net"),
server: {
port: 1313
},
});
const rehypePrettyCodeOpts = {
theme: {
dark: 'rose-pine-moon',
light: 'rose-pine-dawn'
}
}
// TODO: data https://lume.land/plugins/search/#returnpagedata
site.use(date());
site.use(feed({
output: ["/rss.xml", "/index.xml", "/rss.json", "/blog/rss.xml"],
query: "category=blog",
info: {
title: "utf9k",
description: "You are online and logged on to my personal ",
lang: "en",
generator: true
},
items: {
title: "=title",
description: "=description",
published: "=date",
content: "=children",
lang: "=lang",
},
}));
site.use(jsx_preact());
site.use(reading_info());
site.use(remark({
rehypePlugins: [[rehypePrettyCode, rehypePrettyCodeOpts]],
remarkRehype: {
footnoteLabelProperties: {
className: ['sr-only', 'littlefoot--print']
}
}
}));
site.use(vento());
site.use(esbuild());
// TODO: ESBuild + content hashing
site.copy("css");
site.copy("static", ".");
// site.process(
// [".html"],
// async (page) => page.content = await prettier.format(page.content, { parser: "html", printWidth: 120 })
// )
site.filter("taghash", tag => {
const tagColours = [
"lightpink",
"blueviolet",
"fuchsia",
"indigo",
"darkviolet",
"mediumvioletred",
"salmon",
"plum",
"tomato",
"orange",
"darkkhaki",
"royalblue",
"deepskyblue",
"lightseagreen",
"turquoise",
"chocolate",
"brown",
"goldenrod",
"burlywood",
]
const hash = fnv_1a(tag)
const i = Number(hash) % tagColours.length
return tagColours[i]
})
export default site;