diff --git a/.eleventy.js b/.eleventy.js index 4cb6849..9e46827 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -41,10 +41,11 @@ module.exports = function(eleventyConfig) { return Math.min.apply(null, numbers); }); - eleventyConfig.addFilter("filterTagList", tags => { - // should match the list in tags.njk + function filterTagList(tags) { return (tags || []).filter(tag => ["all", "nav", "post", "posts"].indexOf(tag) === -1); - }) + } + + eleventyConfig.addFilter("filterTagList", filterTagList) // Create an array of all tags eleventyConfig.addCollection("tagList", function(collection) { @@ -53,7 +54,7 @@ module.exports = function(eleventyConfig) { (item.data.tags || []).forEach(tag => tagSet.add(tag)); }); - return [...tagSet]; + return filterTagList([...tagSet]); }); // Copy the `img` and `css` folders to the output diff --git a/posts/thirdpost.md b/posts/thirdpost.md index df0ee74..7740e12 100644 --- a/posts/thirdpost.md +++ b/posts/thirdpost.md @@ -4,6 +4,7 @@ description: This is a post on My Blog about win-win survival strategies. date: 2018-08-24 tags: - second tag + - posts with two tags layout: layouts/post.njk --- Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment. diff --git a/tags-list.njk b/tags-list.njk index d37ae36..2553860 100644 --- a/tags-list.njk +++ b/tags-list.njk @@ -4,7 +4,7 @@ layout: layouts/home.njk ---

Tags

-{% for tag in collections.tagList | filterTagList %} +{% for tag in collections.tagList %} {% set tagUrl %}/tags/{{ tag | slug }}/{% endset %} {{ tag }} {% endfor %}