commit d0514b835d18c05f8e0137f7892b0907259bbc89
parent 9ab9731f4095f41a0e68b6aba32747813c0c9853
Author: Taixu Chen <chentaixu@gmail.com>
Date: Mon, 31 Aug 2015 12:04:42 +0800
Modified incorrect usage of Jade API & var names
Change 1:
according to:
http://jade-lang.com/api/
The current Jade API for render method is:
jade.render(source, options) which only accepts two parameters.
Change 2:
Modified variable names so that they better fit their intended meanings.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/api/content.js b/src/api/content.js
@@ -11,9 +11,10 @@ const CONTENT_DIR = join(__dirname, './content');
// Extract 'front matter' metadata and generate HTML
const parseJade = (path, jadeContent) => {
- const content = fm(jadeContent);
- const html = jade.render(content.body, null, ' ');
- const page = Object.assign({ path, content: html }, content.attributes);
+ const fmContent = fm(jadeContent);
+ const jadeOptions = null; // TODO: Modify the parseJade to allow dynamic render option for Jade?
+ const htmlContent = jade.render(fmContent.body, jadeOptions);
+ const page = Object.assign({ path, content: htmlContent }, fmContent.attributes);
return page;
};