Created
November 19, 2017 04:51
-
-
Save firelizzard18/934c274df0e6699e3fcad46cc62df501 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
patch-package | |
--- a/index.js | |
+++ b/index.js | |
@@ -31,12 +31,16 @@ function processFile(filePath) { | |
.then(middleware) | |
.then(getDefaults) | |
.then(data => { | |
+ if (data._draft && !conf.draft) return; | |
+ | |
// If _layout, render it: | |
if (data._layout) return render(data); | |
// Else, return _body: | |
else return data._body; | |
}) | |
.then(html => { | |
+ if (html === void 0) return; | |
+ | |
// Get path to write to using path-extra: | |
var writePath = path.replaceExt(path.join(conf.dist, filePath), '.html'); | |
// Output using fs-extra: | |
@@ -72,7 +76,7 @@ function middleware(data) { | |
case '.md': | |
case '.markdown': | |
// Render markdown: | |
- return marked(data._body) | |
+ return (conf.renderer || marked)(data._body) | |
.then(res => { | |
// Overwrite data._body: | |
data._body = res; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment