mirror of
https://github.com/BradNut/awesome-uses
synced 2025-09-08 17:40:31 +00:00
fix: ignore duplicated tags
This commit is contained in:
parent
ff8dbcbfb7
commit
cfabae56d7
2 changed files with 4 additions and 2 deletions
|
|
@ -5,7 +5,8 @@ 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 => {
|
||||
const person = { ...p, tags: [...new Set(p.tags)] };
|
||||
const nodeMeta = {
|
||||
id: createNodeId(`person-${person.name}`),
|
||||
parent: null,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ import people from '../data.js';
|
|||
|
||||
function merge(prop) {
|
||||
return function(acc, obj) {
|
||||
return [...obj[prop], ...acc];
|
||||
const propEntries = [...new Set(obj[prop])];
|
||||
return [...propEntries, ...acc];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue