Get rid of the _11ty folder—we don’t need it.
This commit is contained in:
29
.eleventy.js
29
.eleventy.js
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user