-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ts
40 lines (34 loc) · 1.37 KB
/
build.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
import { execSync } from 'child_process';
import postCss from 'postcss';
import postcssNested from 'postcss-nested';
import { Builder } from '@robertakarobin/ssg/build.ts';
class CustomBuilder extends Builder {
cleanup() {
try {
execSync(`npm run lint`, { encoding: `utf8`, stdio: `inherit` });
} catch (error) {
}
}
async formatCss(input: string) {
const unnested = await postCss([postcssNested]).process(input, {
from: undefined,
});
let css = unnested.css;
css = await super.formatCss(unnested.css);
return css;
}
formatHead(input: Parameters<Builder[`formatHead`]>[0]) {
return /*html*/`
${super.formatHead({
...input,
description: `The Southeast Minnesota Capital Fund provides early-stage investment capital to Minnesota entrepreneurs building innovative, high growth companies. We invest across the state, with a preference for companies located in or connected to Rochester and SE Minnesota.`,
})}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous">
<link rel="icon" type="image/png" sizes="32x32" href="/assets/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/assets/images/favicon-16x16.png">
`;
}
}
const builder = new CustomBuilder();
await builder.build({ serve: process.argv.includes(`--serve`) });