-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eleventy.js
48 lines (39 loc) · 1.34 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
module.exports = function (eleventyConfig) {
eleventyConfig.setTemplateFormats(['html', 'md', 'njk', '11ty.js', 'css', 'jpg', 'json', 'js']);
let options = {
html: true,
breaks: true,
linkify: true
};
var markdownIt = require("markdown-it")(options);
var markdownItAttrs = require('markdown-it-attrs');
markdownIt.use(markdownItAttrs, {
leftDelimiter: '{',
rightDelimiter: '}',
allowedAttributes: []
});
eleventyConfig.setUseGitIgnore(false);
eleventyConfig.setLibrary("md", markdownIt);
eleventyConfig.addPassthroughCopy("site/img");
eleventyConfig.addFilter("generateGithubIssuesLink", function (name, components) {
let returnValue = 'https://github.com/search?q=';
const arrayComponents = [""];
components.forEach(component => {
if (component.type === "web component" && !arrayComponents.includes(component["element-name"])) {
returnValue += `repo%3Aweb-illinois%2F${component["element-name"]}+`;
arrayComponents.push(component["element-name"]);
}
});
returnValue += 'state%3Aopen&type=Issues&s=created&o=asc'
return returnValue;
});
eleventyConfig.addFilter("markdownify", (markdownString) =>
markdownIt.render(markdownString)
);
return {
dir: {
input: "site"
},
pathPrefix: process.env.PATH_PREFIX || '/'
};
};