@@ -70,25 +70,6 @@ interface ApiReferenceQueryResult {
7070 } ;
7171}
7272
73- interface MdxEdge {
74- node : {
75- id : string ;
76- frontmatter : {
77- slug : string ;
78- title : string ;
79- } ;
80- internal : {
81- contentFilePath : string ;
82- } ;
83- } ;
84- }
85-
86- interface MdxQueryResult {
87- allMdx : {
88- edges : MdxEdge [ ] ;
89- } ;
90- }
91-
9273export const createPages : GatsbyNode [ 'createPages' ] = async ( { graphql, actions : { createPage, createRedirect } } ) => {
9374 /**
9475 * It's not ideal to have:
@@ -124,25 +105,6 @@ export const createPages: GatsbyNode['createPages'] = async ({ graphql, actions:
124105 }
125106 ` ) ;
126107
127- const mdxResult = await graphql < MdxQueryResult > ( `
128- query {
129- allMdx {
130- edges {
131- node {
132- id
133- frontmatter {
134- slug
135- title
136- }
137- internal {
138- contentFilePath
139- }
140- }
141- }
142- }
143- }
144- ` ) ;
145-
146108 /**
147109 * We could log here, the reason we don't right now is that the error should already have been caught and logged.
148110 * Because Gatsby spawns a bunch of async processes during the onCreateNode step, though, and errors don't prevent
@@ -246,30 +208,6 @@ export const createPages: GatsbyNode['createPages'] = async ({ graphql, actions:
246208 return slug ;
247209 } ;
248210
249- const mdxCreator = async ( edge : MdxEdge ) : Promise < string > => {
250- const slug = edge . node . frontmatter . slug ;
251-
252- if ( ! slug ) {
253- return slug ;
254- }
255-
256- const mdxWrapper = path . resolve ( 'src/components/Layout/MDXWrapper.tsx' ) ;
257-
258- console . log ( 'cat' , edge . node . frontmatter ) ;
259-
260- createPage ( {
261- path : slug ,
262- component : `${ mdxWrapper } ?__contentFilePath=${ edge . node . internal . contentFilePath } ` ,
263- context : {
264- slug,
265- title : edge . node . frontmatter . title ,
266- layout : { sidebar : true , searchBar : true , template : 'base' } ,
267- } ,
268- } ) ;
269-
270- return slug ;
271- } ;
272-
273211 createRedirect ( {
274212 fromPath : '/' ,
275213 toPath : '/docs' ,
@@ -293,11 +231,8 @@ export const createPages: GatsbyNode['createPages'] = async ({ graphql, actions:
293231 throw new Error ( 'API reference result is undefined' ) ;
294232 }
295233
296- console . log ( 'lucie' , mdxResult . data ) ;
297-
298234 await Promise . all ( [
299235 ...documentResult . data . allFileHtml . edges . map ( documentCreator ( documentTemplate ) ) ,
300236 ...apiReferenceResult . data . allFileHtml . edges . map ( documentCreator ( apiReferenceTemplate ) ) ,
301- ...( mdxResult . data ?. allMdx . edges . map ( mdxCreator ) ?? [ ] ) ,
302237 ] ) ;
303238} ;
0 commit comments