Guest User

Untitled

a guest
Nov 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. patch-package
  2. --- a/index.js
  3. +++ b/index.js
  4. @@ -31,12 +31,16 @@ function processFile(filePath) {
  5. .then(middleware)
  6. .then(getDefaults)
  7. .then(data => {
  8. + if (data._draft && !conf.draft) return;
  9. +
  10. // If _layout, render it:
  11. if (data._layout) return render(data);
  12. // Else, return _body:
  13. else return data._body;
  14. })
  15. .then(html => {
  16. + if (html === void 0) return;
  17. +
  18. // Get path to write to using path-extra:
  19. var writePath = path.replaceExt(path.join(conf.dist, filePath), '.html');
  20. // Output using fs-extra:
  21. @@ -72,7 +76,7 @@ function middleware(data) {
  22. case '.md':
  23. case '.markdown':
  24. // Render markdown:
  25. - return marked(data._body)
  26. + return (conf.renderer || marked)(data._body)
  27. .then(res => {
  28. // Overwrite data._body:
  29. data._body = res;
Add Comment
Please, Sign In to add comment