diff --git a/.eleventy.js b/.eleventy.js index 869a91c..95ccb7f 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,6 +1,7 @@ const rssPlugin = require('@11ty/eleventy-plugin-rss'); const syntaxHighlight = require('@11ty/eleventy-plugin-syntaxhighlight'); const fs = require('fs'); +const util = require('util') // Import filters const dateFilter = require('./src/filters/date-filter.js'); @@ -19,6 +20,9 @@ module.exports = function(config) { config.addFilter('dateFilter', dateFilter); config.addFilter('markdownFilter', markdownFilter); config.addFilter('w3DateFilter', w3DateFilter); + config.addFilter('dump', obj => { + return util.inspect(obj) + }); // Layout aliases config.addLayoutAlias('home', 'layouts/home.njk'); @@ -77,24 +81,35 @@ module.exports = function(config) { config.addCollection("tagsList", function(collectionApi) { const tagsList = new Set(); collectionApi.getAll().map( item => { - if (item.data.tags) { // handle pages that don't have tags - item.data.tags.map( tag => tagsList.add(tag)) - } - }); - return tagsList; + if (item.data.tags) { // handle pages that don't have tags + item.data.tags.map( tag => tagsList.add(tag)) + } + }); + return tagsList; }); config.addCollection("skillsList", function(collectionApi) { const skillsList = new Set(); collectionApi.getFilteredByGlob("./src/members/*.md").map( item => { - if (item.data.tags) { // handle pages that don't have skills - item.data.tags.map( skill => { // exclude non related tags - if (['post', 'news', 'event'].indexOf(skill) == -1) { - skillsList.add(skill) - } - }) - } - }); - return skillsList; + if (item.data.tags) { // handle pages that don't have skills + item.data.tags.map( skill => { // exclude non related tags + if (['post', 'news', 'event'].indexOf(skill) == -1) { + skillsList.add(skill) + } + }) + } + }); + return skillsList; + }); + config.addCollection("membersLocations", function(collectionApi) { + return collectionApi.getFilteredByGlob("./src/members/*.md") + .filter(item => typeof item.data.location !== 'undefined') + .map( member => { + return { + name: member.data.name, + url: member.data.url, + location: member.data.location, + }; + }); }); config.addCollection('customers', collection => { return [...collection.getFilteredByGlob("./src/customers/*.md")] diff --git a/src/_includes/layouts/team.njk b/src/_includes/layouts/team.njk index b71fe13..608fa49 100644 --- a/src/_includes/layouts/team.njk +++ b/src/_includes/layouts/team.njk @@ -7,7 +7,6 @@