diff --git a/gatsby-node.js b/gatsby-node.js index 8f64c729..a70e9aec 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -5,7 +5,9 @@ function sourceNodes({ actions, createNodeId, createContentDigest }) { // Add People to the GraphQL API, we randomize the data on each build so no one gets their feelings hurt people .sort(() => Math.random() - 0.5) - .forEach(person => { + .forEach(p => { + // Remove duplicated tags. + const person = { ...p, tags: [...new Set(p.tags)] }; const nodeMeta = { id: createNodeId(`person-${person.name}`), parent: null, diff --git a/src/util/stats.js b/src/util/stats.js index d41e05d8..f016702d 100644 --- a/src/util/stats.js +++ b/src/util/stats.js @@ -3,7 +3,9 @@ import people from '../data.js'; function merge(prop) { return function(acc, obj) { - return [...obj[prop], ...acc]; + // Remove duplicated values. + const values = [...new Set(obj[prop])]; + return [...values, ...acc]; }; }