File tree 4 files changed +7
-8
lines changed
4 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1
1
import frontMatter from 'front-matter'
2
2
import markdownIt from 'markdown-it'
3
3
import hljs from 'highlight.js'
4
- import _ from 'underscore '
4
+ import objectAssign from 'object-assign '
5
5
6
6
const highlight = ( str , lang ) => {
7
7
if ( ( lang !== null ) && hljs . getLanguage ( lang ) ) {
@@ -31,7 +31,7 @@ module.exports = function (content) {
31
31
this . cacheable ( )
32
32
const meta = frontMatter ( content )
33
33
body = md . render ( meta . body )
34
- const result = _ . extend ( { } , meta . attributes , {
34
+ const result = objectAssign ( { } , meta . attributes , {
35
35
body,
36
36
} )
37
37
this . value = result
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import ReactDOMServer from 'react-dom/server'
6
6
import webpack from 'webpack'
7
7
import Negotiator from 'negotiator'
8
8
import parsePath from 'parse-filepath'
9
- import _ from 'underscore '
9
+ import find from 'lodash/find '
10
10
import webpackRequire from 'webpack-require'
11
11
import fs from 'fs'
12
12
import toml from 'toml'
@@ -102,7 +102,7 @@ module.exports = (program) => {
102
102
} else {
103
103
// Rewrite path to match disk path.
104
104
const parsed = parsePath ( request . path )
105
- const page = _ . find ( pages , ( p ) => p . path === ( `${ parsed . dirname } /` ) )
105
+ const page = find ( pages , ( p ) => p . path === ( `${ parsed . dirname } /` ) )
106
106
107
107
if ( page ) {
108
108
request . setUrl ( `/${ parsePath ( page . requirePath ) . dirname } /${ parsed . basename } ` )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import slash from 'slash'
5
5
import fs from 'fs'
6
6
import frontMatter from 'front-matter'
7
7
import htmlFrontMatter from 'html-frontmatter'
8
- import _ from 'underscore '
8
+ import objectAssign from 'object-assign '
9
9
const debug = require ( 'debug' ) ( 'gatsby:glob' )
10
10
11
11
module . exports = ( directory , callback ) => {
@@ -39,11 +39,11 @@ module.exports = (directory, callback) => {
39
39
let data
40
40
if ( ext === 'md' ) {
41
41
const rawData = frontMatter ( fs . readFileSync ( page , 'utf-8' ) )
42
- data = _ . extend ( { } , rawData . attributes )
42
+ data = objectAssign ( { } , rawData . attributes )
43
43
pageData . data = data
44
44
} else if ( ext === 'html' ) {
45
45
const html = fs . readFileSync ( page , 'utf-8' )
46
- data = _ . extend ( { } , htmlFrontMatter ( html ) , { body : html } )
46
+ data = objectAssign ( { } , htmlFrontMatter ( html ) , { body : html } )
47
47
pageData . data = data
48
48
} else {
49
49
data = { }
Original file line number Diff line number Diff line change 68
68
"toml" : " ^2.2.2" ,
69
69
"toml-loader" : " ^1.0.0" ,
70
70
"typography" : " ^0.7.0" ,
71
- "underscore" : " ^1.8.3" ,
72
71
"underscore.string" : " ^3.2.3" ,
73
72
"webpack" : " ^1.12.13" ,
74
73
"webpack-configurator" : " ^0.3.0" ,
You can’t perform that action at this time.
0 commit comments