-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatsby-node.js
More file actions
47 lines (42 loc) · 1.08 KB
/
gatsby-node.js
File metadata and controls
47 lines (42 loc) · 1.08 KB
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
const createVideoPages = require("./gatsby-node/createVideoPages")
const createVideoCategoryPages = require("./gatsby-node/createVideoCategoryPages")
const { createRemoteFileNode } = require("gatsby-source-filesystem")
exports.createPages = async ({ graphql, actions }) => {
await createVideoPages({ graphql, actions })
await createVideoCategoryPages({ graphql, actions })
}
exports.createResolvers = ({
actions,
cache,
createNodeId,
createResolvers,
store,
reporter,
}) => {
const { createNode } = actions
createResolvers({
WP_MediaItem: {
imageFile: {
type: "File",
resolve(source, args, context, info) {
return createRemoteFileNode({
url: source.sourceUrl,
store,
cache,
createNode,
createNodeId,
reporter,
})
},
},
},
})
}
exports.onCreatePage = async ({ page, actions }) => {
const { createPage } = actions
if (page.path.match(/^\/account/)) {
page.matchPath = "/account/*"
// Update the page.
createPage(page)
}
}