diff --git a/.eleventy.js b/.eleventy.js index 9e46827..eb21532 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -29,6 +29,9 @@ module.exports = function(eleventyConfig) { // Get the first `n` elements of a collection. eleventyConfig.addFilter("head", (array, n) => { + if(!Array.isArray(array) || array.length === 0) { + return []; + } if( n < 0 ) { return array.slice(n); }