diff --git a/lib/hexo/post.js b/lib/hexo/post.js index 58814d1c72..3a0075ef3d 100644 --- a/lib/hexo/post.js +++ b/lib/hexo/post.js @@ -4,8 +4,6 @@ const assert = require('assert'); const moment = require('moment'); const Promise = require('bluebird'); const { join, extname } = require('path'); -const assignIn = require('lodash/assignIn'); -const clone = require('lodash/clone'); const chalk = require('chalk'); const yaml = require('js-yaml'); const { slugize, escapeRegExp } = require('hexo-util'); @@ -121,7 +119,7 @@ Post.prototype._renderScaffold = function(data) { let yfmSplit; return this._getScaffold(data.layout).then(scaffold => { - const frontMatter = prepareFrontMatter(clone(data)); + const frontMatter = prepareFrontMatter({...data}); yfmSplit = yfm.split(scaffold); return tag.render(yfmSplit.data, frontMatter); @@ -202,7 +200,7 @@ Post.prototype.publish = function(data, replace, callback) { return fs.readFile(src); }).then(content => { // Create post - assignIn(data, yfm(content)); + Object.assign(data, yfm(content)); data.content = data._content; delete data._content;