-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.js
39 lines (37 loc) · 957 Bytes
/
gatsby-node.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
exports.createPages = async ({ actions: {createPage, createSlice}, graphql }) => {
createSlice({
id: `header`,
component: require.resolve(`./src/components/header.js`),
});
createSlice({
id: `footer`,
component: require.resolve(`./src/components/footer.js`),
});
createSlice({
id: `contact-icons`,
component: require.resolve(`./src/components/contact-icons.js`),
});
createSlice({
id: `contact-text`,
component: require.resolve(`./src/components/contact-text.js`),
});
const { data } = await graphql(`
query {
allContentfulPortfolioEntry {
edges {
node {
slug
}
}
}
}
`);
data.allContentfulPortfolioEntry.edges.forEach(edge => {
const slug = edge.node.slug
createPage({
path: `featured-work/${slug}`,
component: require.resolve(`./src/templates/portfolio-entry.js`),
context: { slug: slug },
})
})
};