blob: c9f5ba094a0d93c7d7e01dd0fc614fe2f2bf04a0 (
plain) (
blame)
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
|
import { formatDate, getTimestamp } from "./util/timestamp";
import BuildInfo from "../config.json";
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default function (eleventyConfig: any) {
// passthrough static files to public
eleventyConfig.addPassthroughCopy({
"./src/static/": "/",
});
// hook in configured build time for GH action to update
eleventyConfig.addGlobalData("site", () => BuildInfo);
eleventyConfig.addGlobalData("buildTimeEncoded", () => {
return getTimestamp(Number(BuildInfo.version));
});
// add `date` filter
eleventyConfig.addFilter("formatDate", formatDate);
// ensure eleventy marks this config as watched, since it's typescript
eleventyConfig.addWatchTarget("./src/config.ts");
return {
templateFormats: ["njk", "html"],
htmlTemplateEngine: "njk",
dir: {
input: "src/pages",
includes: "../templates",
output: "public",
},
};
}
|