-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eleventy.js
41 lines (33 loc) · 1.1 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
export const config = {
markdownTemplateEngine: "njk",
};
export default async function(eleventyConfig) {
eleventyConfig.setIncludesDirectory("_layouts");
let types = ["csv", "css", "js", "jpg", "png", "json", "svg"];
let pathPairs = [
["collections/_visualizations/Trends-in-High-School-GPAs-of-Incoming-Freshman",
"visualizations/Trends-in-High-School-GPAs-of-Incoming-Freshman"],
//["covid-19", "covid-19"],
//["discovery", "discovery"],
]
for (let pathPair of pathPairs) {
for (let type of types) {
let key = `${pathPair[0]}/**/*.${type}`;
let value = `${pathPair[1]}/`;
let d = {};
d[key] = value;
// console.log(d);
eleventyConfig.addPassthroughCopy(d);
}
}
//eleventyConfig.setTemplateFormats(["csv", "css", "js", "jpg", "png", "json", "md", "html"]);
eleventyConfig.addPairedShortcode("card", (body, cardTitle) => {
console.log(body);
return `<div class="card box-shadow px-2 mb-3">
<div class="card-body">
<h4 class="card-title">${cardTitle}</h4><p>${body}</p>
</div>
</div>`;
}
)
};