Get rid of the _11ty folder—we don’t need it.

This commit is contained in:
Zach Leatherman
2020-07-27 15:18:51 -05:00
parent 5fb79c5849
commit 75e71adb29
4 changed files with 31 additions and 30 deletions

View File

@@ -33,7 +33,34 @@ module.exports = function(eleventyConfig) {
return array.slice(0, n);
});
eleventyConfig.addCollection("tagList", require("./_11ty/getTagList"));
eleventyConfig.addCollection("tagList", function(collection) {
let tagSet = new Set();
collection.getAll().forEach(function(item) {
if( "tags" in item.data ) {
let tags = item.data.tags;
tags = tags.filter(function(item) {
switch(item) {
// this list should match the `filter` list in tags.njk
case "all":
case "nav":
case "post":
case "posts":
return false;
}
return true;
});
for (const tag of tags) {
tagSet.add(tag);
}
}
});
// returning an array in addCollection works in Eleventy 0.5.3
return [...tagSet];
});
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPassthroughCopy("css");