11// See: https://www.gatsbyjs.org/docs/node-apis/
22
33// https://www.gatsbyjs.org/docs/add-custom-webpack-config/
4- exports . onCreateWebpackConfig = ( {
5- getConfig,
6- actions,
7- plugins,
8- } ) => {
4+ exports . onCreateWebpackConfig = ( { getConfig, actions, plugins } ) => {
95 const config = getConfig ( )
106
117 // Hides "[HMR] ..." logs in devtools
128 if ( config . entry . commons ) {
13- config . entry . commons = config . entry . commons . map ( path => (
9+ config . entry . commons = config . entry . commons . map ( path =>
1410 // Add query param to entry added by Gatsby CLI https://git.io/JvAC5
15- path . indexOf ( '/webpack-hot-middleware/client.js?' ) > - 1 ?
16- path + '&quiet=true' : path
17- ) )
11+ path . indexOf ( "/webpack-hot-middleware/client.js?" ) > - 1
12+ ? path + "&quiet=true"
13+ : path
14+ )
1815 }
1916
2017 actions . replaceWebpackConfig ( config )
@@ -24,13 +21,12 @@ exports.onCreateWebpackConfig = ({
2421 // Hides React Devtools advertisement in devtools
2522 // https://tinyurl.com/hide-react-devtools-advert
2623 plugins . define ( {
27- __REACT_DEVTOOLS_GLOBAL_HOOK__ : "({ isDisabled: true })"
28- } )
29- ]
24+ __REACT_DEVTOOLS_GLOBAL_HOOK__ : "({ isDisabled: true })" ,
25+ } ) ,
26+ ] ,
3027 } )
3128}
3229
33-
3430const { createFilePath } = require ( "gatsby-source-filesystem" )
3531
3632exports . onCreateNode = ( { node, actions, getNode } ) => {
@@ -42,12 +38,11 @@ exports.onCreateNode = ({ node, actions, getNode }) => {
4238 createNodeField ( {
4339 name : "slug" ,
4440 node,
45- value
41+ value,
4642 } )
4743 }
4844}
4945
50-
5146const path = require ( "path" )
5247
5348exports . createPages = async ( { graphql, actions, reporter } ) => {
@@ -97,7 +92,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
9792 createPage ( {
9893 path : node . fields . slug ,
9994 component : path . resolve ( "./src/components/mdx-custom-renderer.js" ) ,
100- context : node
95+ context : node ,
10196 } )
10297 } )
10398}
@@ -131,6 +126,43 @@ exports.createSchemaCustomization = ({ actions }) => {
131126
132127 type Site {
133128 pathPrefix: String
129+ siteMetadata: SiteMetadata
130+ }
131+
132+ type CloudflareDocs {
133+ pathPrefix: String
134+ product: String
135+ productIconKey: String
136+ productLogoPathD: String
137+ logoSVGContent: String
138+ contentRepo: String
139+ contentRepoFolder: String
140+ search: AlgoliaSearch
141+ externalLinks: [ExternalLinksType]
142+ }
143+
144+ type ExternalLinksType {
145+ title: String
146+ url: String
147+ }
148+
149+ type AlgoliaOptions {
150+ facetFilters: String
151+ }
152+
153+ type AlgoliaSearch {
154+ indexName: String
155+ apiKey: String
156+ algoliaOptions: AlgoliaOptions
157+ }
158+
159+ type SiteMetadata {
160+ cloudflareDocs: CloudflareDocs
161+ title: String
162+ description: String
163+ author: String
164+ url: String
165+ image: String
134166 }
135167 `
136168
0 commit comments