-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eleventy.js
59 lines (48 loc) · 1.81 KB
/
.eleventy.js
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
import yaml from "js-yaml"
import pluginRss from "@11ty/eleventy-plugin-rss"
import { EleventyRenderPlugin } from "@11ty/eleventy"
import filters from "./src/_11ty/filters.js"
import markdown from "./src/_11ty/markdown.js"
import opengraphImages from "./src/_11ty/plugins/opengraph-images/index.js"
import pluginSubfont from "./src/_11ty/plugins/eleventy-plugin-subfont/index.js"
const CONTENT_GLOBS = {
articles: "src/articles/**/**.md",
}
/** @param {import("@11ty/eleventy/src/UserConfig").default} config */
export default async function (config) {
config.addDataExtension("yaml", (contents) => yaml.load(contents))
// TODO: simplify if possible
config.addPassthroughCopy({ "./src/_assets/*.css": "assets/css" })
config.addPassthroughCopy({ "./src/_assets/*.svg": "assets/img" })
config.addPassthroughCopy({ "./src/_assets/fonts/*": "assets/fonts" })
config.addPassthroughCopy({ "./src/_assets/*.js": "assets/js" })
config.addPassthroughCopy({ "./src/articles/images/*": "assets/img" })
config.addPassthroughCopy({ "./src/articles/videos/*": "assets/videos" })
config.addPassthroughCopy({ "./src/_assets/og": "assets/og" })
config.addPassthroughCopy({ "./src/_assets/*.txt": "/" })
config.addWatchTarget("./src/_assets/main.css")
// External plugins
config.addPlugin(EleventyRenderPlugin)
config.addPlugin(pluginRss)
// Shortcodes
config.addShortcode("now", () => new Date().getFullYear())
// Filters
config.addPlugin(filters)
// Markdown config
config.addPlugin(markdown)
config.addPlugin(opengraphImages)
config.addPlugin(pluginSubfont, {
inlineCss: true,
text: "H",
enabled: process.ELEVENTY_ENV == "production",
})
return {
// markdownTemplateEngine: "njk",
dir: {
output: "dist",
input: "src",
includes: "_includes",
data: "data",
},
}
}