-
Notifications
You must be signed in to change notification settings - Fork 0
/
gatsby-node.js
53 lines (48 loc) · 951 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const path = require('path')
exports.createPages = async ({ actions, graphql }) => {
const { createPage } = actions
const pageMaker = (type, data) => {
data.map(({ node }) => {
const { uid } = node
createPage({
component: path.resolve(`src/templates/${type}.js`),
context: {
uid,
},
path: uid,
})
return false
})
}
const pages = await graphql(`
{
volumes: allPrismicVolume {
edges {
node {
uid
}
}
}
chapters: allPrismicChapter {
edges {
node {
uid
}
}
}
texts: allPrismicText {
edges {
node {
uid
}
}
}
}
`)
pageMaker('texts', pages.data.texts.edges)
}
exports.onCreateBabelConfig = ({ actions }) => {
actions.setBabelPlugin({
name: 'babel-plugin-tailwind',
})
}