-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathgatsby-node.js
More file actions
26 lines (23 loc) · 955 Bytes
/
gatsby-node.js
File metadata and controls
26 lines (23 loc) · 955 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
const { createRedirects, createMarkdownPages } = require(`./gatsby/createPages`);
const onCreateNode = require(`./gatsby/onCreateNode`);
const { parse } = require('./utils/auto-schema');
const parseRSSchema = require('./utils/auto-schema');
exports.onPreBootstrap = ({ reporter }) => {
if (process.env.SKIP_SCHEMA) {
reporter.info('skipping schema generation (SKIP_SCHEMA is set)');
return;
}
reporter.info('generating the schema files for ReactiveSearch API');
parseRSSchema.parse();
reporter.info('generating the schema for the Pipelines API');
parseRSSchema.parsePipeline();
};
exports.createPages = ({ graphql, actions }) => {
const { createRedirect, createPage } = actions;
return Promise.all([
createRedirects({ createRedirect }),
createMarkdownPages(graphql, { createPage, createRedirect }),
]);
};
exports.onCreateNode = async ({ node, getNode, actions }) =>
onCreateNode.createMarkdownNodeFields({ node, getNode, actions });