Skip to content

Commit

Permalink
support layout
Browse files Browse the repository at this point in the history
  • Loading branch information
joeferner committed May 17, 2012
1 parent 078d19a commit c3bb15b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/format/html/index.js
Expand Up @@ -75,9 +75,12 @@ function sortFiles(filesToSort) {

function render(filePath, templatePath, viewData, callback) {
mkdirp.sync(path.dirname(filePath));
var layoutPath = path.join(__dirname, 'layout.ejs');
var layout = fs.readFileSync(layoutPath, 'utf8');
var template = fs.readFileSync(templatePath, 'utf8');
viewData.renderPieChart = renderPieChart;
var html = ejs.render(template, viewData);
viewData.body = ejs.render(template, viewData);
var html = ejs.render(layout, viewData);
fs.writeFile(filePath, html, callback);
}

Expand Down
4 changes: 4 additions & 0 deletions lib/format/html/layout.ejs
@@ -0,0 +1,4 @@
<!doctype html>
<html lang="en">
<%- body %>
</html>

0 comments on commit c3bb15b

Please sign in to comment.