forked from techlore/plexus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-node.js
More file actions
37 lines (35 loc) · 800 Bytes
/
gatsby-node.js
File metadata and controls
37 lines (35 loc) · 800 Bytes
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
const path = require(`path`);
const { createFilePath } = require(`gatsby-source-filesystem`);
exports.createPages = async ({ graphql, actions }) => {
const { createPage } = actions;
const result = await graphql(`
query {
allPlexusCsv {
edges {
node {
Application
id
MicroG_Notes
MicroG_Rating__1_4_
Month
Notes
Rating__1_4_
Year
fields {
slug
}
}
}
}
}
`);
result.data.allPlexusCsv.edges.forEach(({ node }) => {
createPage({
path: `/applications/${node.fields.slug}`,
component: path.resolve(`./src/templates/application.js`),
context: {
node,
},
});
});
};