Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

support layout

  • Loading branch information...
commit c3bb15b23e74dc78e98d921d9d53d3c52324b72a 1 parent 078d19a
@joeferner joeferner authored
Showing with 8 additions and 1 deletion.
  1. +4 −1 lib/format/html/index.js
  2. +4 −0 lib/format/html/layout.ejs
View
5 lib/format/html/index.js
@@ -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);
}
View
4 lib/format/html/layout.ejs
@@ -0,0 +1,4 @@
+<!doctype html>
+<html lang="en">
+ <%- body %>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.