-
Notifications
You must be signed in to change notification settings - Fork 0
/
_config.ts
120 lines (109 loc) · 2.77 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
import lume from "lume/mod.ts";
/* Plugins */
import cssnano from "npm:cssnano";
import date from "lume/plugins/date.ts";
import favicon from "lume/plugins/favicon.ts";
import feed from "lume/plugins/feed.ts";
import inline from "lume/plugins/inline.ts";
import jsx from "lume/plugins/jsx_preact.ts";
import minifyHTML from "lume/plugins/minify_html.ts";
import picture from "lume/plugins/picture.ts";
import postcss from "lume/plugins/postcss.ts";
import prism from "lume/plugins/prism.ts";
import resolveUrls from "lume/plugins/resolve_urls.ts";
import slugifyUrls from "lume/plugins/slugify_urls.ts";
import toc from "mdtoc/toc.ts";
import toml from "lume/plugins/toml.ts";
import robots from "lume/plugins/robots.ts";
import transformImages from "lume/plugins/transform_images.ts";
/* Prism syntaxes */
import "npm:[email protected]/components/prism-coffeescript.js";
import "npm:[email protected]/components/prism-makefile.js";
import "npm:[email protected]/components/prism-nginx.js";
import "npm:[email protected]/components/prism-ruby.js";
import "npm:[email protected]/components/prism-scss.js";
const site = lume({
src: "./src",
prettyUrls: false,
});
site.remoteFile(
"_includes/styles/prism.css",
"https://unpkg.com/[email protected]/themes/prism-dracula.css",
);
site.copy("fonts");
const numberFormatter = new Intl.NumberFormat();
site.filter("number", (value) => numberFormatter.format(value));
const listFormatter = new Intl.ListFormat();
site.filter("list", (value) => listFormatter.format(value));
site.use(postcss());
site.hooks.addPostcssPlugin(cssnano);
site
.use(toml())
.use(resolveUrls())
.use(slugifyUrls({ lowercase: true }))
.use(toc({ anchor: false }))
.use(jsx())
.use(date())
.use(picture())
.use(transformImages())
.use(prism())
.use(favicon({
input: "favicon.svg",
}))
.use(feed({
output: ["/index.xml", "/index.json"],
query: "type=post",
sort: "date=desc",
limit: 50,
info: {
title: "=site.title",
description: "=site.description",
},
items: {
title: "=title",
},
}))
.use(inline({ attribute: "rel='stylesheet'" }))
.use(minifyHTML({
options: {
keep_spaces_between_attributes: true,
},
}));
// List taken from https://github.com/ai-robots-txt/ai.robots.txt
site.use(robots({
disallow: [
"AdsBot-Google",
"Amazonbot",
"anthropic-ai",
"Applebot-Extended",
"AwarioRssBot",
"AwarioSmartBot",
"Bytespider",
"CCBot",
"ChatGPT-User",
"ClaudeBot",
"Claude-Web",
"cohere-ai",
"DataForSeoBot",
"Diffbot",
"FacebookBot",
"FriendlyCrawler",
"Google-Extended",
"GoogleOther",
"GPTBot",
"img2dataset",
"ImagesiftBot",
"magpie-crawler",
"Meltwater",
"omgili",
"omgilibot",
"peer39_crawler",
"peer39_crawler/1.0",
"PerplexityBot",
"PiplBot",
"scoop.it",
"Seekr",
"YouBot",
],
}));
export default site;