Get rid of the _11ty folder—we don’t need it.
This commit is contained in:
parent
5fb79c5849
commit
75e71adb29
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");
|
||||
|
@ -1,2 +1 @@
|
||||
README.md
|
||||
_11ty/
|
||||
|
@ -1,28 +0,0 @@
|
||||
module.exports = 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];
|
||||
};
|
@ -23,6 +23,8 @@
|
||||
</header>
|
||||
|
||||
<main{% if templateClass %} class="{{ templateClass }}"{% endif %}>
|
||||
|
||||
<!-- Delete this message -->
|
||||
<div class="warning">
|
||||
<ol>
|
||||
<li>Edit the <code>_data/metadata.json</code> with your blog’s information.</li>
|
||||
@ -31,6 +33,7 @@
|
||||
</ol>
|
||||
<p><em>This is an <a href="https://www.11ty.dev/">Eleventy project</a> created from the <a href="https://github.com/11ty/eleventy-base-blog"><code>eleventy-base-blog</code> repo</a>.</em></p>
|
||||
</div>
|
||||
<!-- Stop deleting -->
|
||||
|
||||
{{ content | safe }}
|
||||
</main>
|
||||
|
Loading…
Reference in New Issue
Block a user