diff --git a/gatsby-node.js b/gatsby-node.js index f3084861..a70e9aec 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -6,6 +6,7 @@ function sourceNodes({ actions, createNodeId, createContentDigest }) { people .sort(() => Math.random() - 0.5) .forEach(p => { + // Remove duplicated tags. const person = { ...p, tags: [...new Set(p.tags)] }; const nodeMeta = { id: createNodeId(`person-${person.name}`), diff --git a/src/util/stats.js b/src/util/stats.js index 862cf86b..f016702d 100644 --- a/src/util/stats.js +++ b/src/util/stats.js @@ -3,8 +3,9 @@ import people from '../data.js'; function merge(prop) { return function(acc, obj) { - const propEntries = [...new Set(obj[prop])]; - return [...propEntries, ...acc]; + // Remove duplicated values. + const values = [...new Set(obj[prop])]; + return [...values, ...acc]; }; }