@@ -12,6 +12,7 @@ import { join } from 'path';
12
12
import Promise from 'bluebird' ;
13
13
import jade from 'jade' ;
14
14
import fm from 'front-matter' ;
15
+ import MarkdownIt from 'markdown-it' ;
15
16
16
17
import {
17
18
GraphQLString as StringType ,
@@ -20,7 +21,7 @@ import {
20
21
21
22
import ContentType from '../types/ContentType' ;
22
23
23
- const md = require ( 'markdown-it' ) ( ) ;
24
+ const md = new MarkdownIt ( ) ;
24
25
25
26
// A folder with Jade/Markdown/HTML content pages
26
27
const CONTENT_DIR = join ( __dirname , './content' ) ;
@@ -42,7 +43,8 @@ const parseContent = (path, fileContent, extension) => {
42
43
default :
43
44
return null ;
44
45
}
45
- return Object . assign ( { path, content : htmlContent } , fmContent . attributes ) ;
46
+ const smth = Object . assign ( { path, content : htmlContent } , fmContent . attributes ) ;
47
+ return smth ;
46
48
} ;
47
49
48
50
const readFile = Promise . promisify ( fs . readFile ) ;
@@ -84,7 +86,7 @@ async function resolveFileName(path) {
84
86
return { success : false , fileName : null , extension : null } ;
85
87
}
86
88
87
- export default {
89
+ const content = {
88
90
type : ContentType ,
89
91
args : {
90
92
path : { type : new NonNull ( StringType ) } ,
@@ -99,3 +101,5 @@ export default {
99
101
return parseContent ( path , source , extension ) ;
100
102
} ,
101
103
} ;
104
+
105
+ export default content ;
0 commit comments