-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.esm.js
39 lines (35 loc) · 961 Bytes
/
gatsby-node.esm.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import dataFilter from './src/components/dataFilter';
const path = require('path')
exports.createPages = async ({ page, actions, graphql }) => {
const { createPage } = actions;
const indexUserTemplate = path.resolve('./src/pages/user.js');
await graphql(`{
allContentfulArchitects {
nodes {
birthDate
lang
name
path
timeline {
timeline
}
video
description
}
distinct(field: path)
}
}`)
.then((architectors) => {
architectors.data.allContentfulArchitects.distinct.forEach((pathUser) => {
// const architectDataFiltered = new dataFilter(architectors.data.allContentfulArchitects.nodes)
// .filterByField({ path: pathUser });
createPage({
path: `/user/${pathUser}`,
component: indexUserTemplate,
context: {
multilangData: pathUser
}
})
});
});
}