diff --git a/_11ty/getTagList.js b/_11ty/getTagList.js index 6b2882a..60077c1 100644 --- a/_11ty/getTagList.js +++ b/_11ty/getTagList.js @@ -1,5 +1,5 @@ module.exports = function(collection) { - let tagList = {}; + let tagSet = new Set(); collection.getAllSorted().forEach(function(item) { if( "tags" in item.data ) { let tags = item.data.tags; @@ -18,12 +18,11 @@ module.exports = function(collection) { } return true; - }).forEach(function(tag) { - tagList[tag] = true; }); + tagSet.add(...tags); } }); // returning an array in addCollection works in Eleventy 0.5.3 - return Object.keys(tagList); + return [...tagSet]; };