This repository has been archived by the owner on Jul 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
.eleventy.js
61 lines (47 loc) · 1.95 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
60
61
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight");
const yaml = require("js-yaml");
module.exports = function(eleventyConfig) {
// Load site-specific data
const siteName = process.env.ESLINT_SITE_NAME || "en";
eleventyConfig.addGlobalData("site_name", siteName);
// Support YAML data files
eleventyConfig.addDataExtension("yml", contents => yaml.load(contents));
/*****************************************************************************************
* Plugins
* ***************************************************************************************/
eleventyConfig.addPlugin(syntaxHighlight, {
alwaysWrapLineHighlights: true,
});
eleventyConfig.addWatchTarget("./src/assets/");
/*****************************************************************************************
* File PassThroughs
* ***************************************************************************************/
eleventyConfig.addPassthroughCopy({
"./src/static": "/"
});
eleventyConfig.addPassthroughCopy('./src/assets/');
return {
passthroughFileCopy: true,
/*
* When deployed, this app is loaded from /play and proxied to
* the correct server. To ensure that URLs are correct, we need
* to apply a prefix.
*
* To ensure that we can get valid deploy previews, we need to
* omit the path prefix in that context. `CONTEXT` is an env
* variable defined by Netlify that specifies where the app
* is being deployed.
*/
pathPrefix: process.env.CONTEXT === "deploy-preview" ? "" : "/play",
markdownTemplateEngine: 'njk',
dataTemplateEngine: 'njk',
htmlTemplateEngine: 'njk',
dir: {
input: "src",
includes: "_includes",
layouts: "_includes/layouts",
data: "_data",
output: "_site"
}
};
};