commit
98ae765a08
|
@ -40,6 +40,11 @@ function compilePost(filepath, data, fileData, callback) {
|
||||||
const rendered = render(frontMatter.body);
|
const rendered = render(frontMatter.body);
|
||||||
const metadata = fileMetadata(filepath);
|
const metadata = fileMetadata(filepath);
|
||||||
|
|
||||||
|
if (frontMatter.attributes.draft) {
|
||||||
|
callback(null, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let published;
|
let published;
|
||||||
if (frontMatter.attributes.date) {
|
if (frontMatter.attributes.date) {
|
||||||
published = moment(frontMatter.attributes.date);
|
published = moment(frontMatter.attributes.date);
|
||||||
|
@ -99,9 +104,13 @@ Compiler.prototype.addFile = function(filepath, isPost, callback) {
|
||||||
], (err, result) => {
|
], (err, result) => {
|
||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
|
|
||||||
this.data.posts.push(result);
|
if (result == null) {
|
||||||
console.log("[Compiler] File %s compiled", filepath);
|
callback();
|
||||||
callback();
|
} else {
|
||||||
|
this.data.posts.push(result);
|
||||||
|
console.log("[Compiler] File %s compiled", filepath);
|
||||||
|
callback();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
async.waterfall([
|
async.waterfall([
|
||||||
|
|
|
@ -68,7 +68,7 @@ const config = {
|
||||||
new webpack.HotModuleReplacementPlugin(),
|
new webpack.HotModuleReplacementPlugin(),
|
||||||
new webpack.NoEmitOnErrorsPlugin(),
|
new webpack.NoEmitOnErrorsPlugin(),
|
||||||
new webpack.NamedModulesPlugin(),
|
new webpack.NamedModulesPlugin(),
|
||||||
new ManifestPlugin({'writeToFileEmit': true})
|
new ManifestPlugin({'writeToFileEmit': true}),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
module.exports = config
|
module.exports = config
|
||||||
|
|
Loading…
Reference in New Issue