Render index.html from mustache templates & dynamic data
function renderSite(){ | |
context.log("render site"); | |
var pageFile = ""; | |
mu.compileText('index.mustache', context.bindings.indexTemplate, function (err, parsed) { | |
var renderstream = mu.render(parsed, { news: mynews, links: mylinks }); | |
renderstream.on('data', function (data) { | |
pageFile += data; | |
}); | |
renderstream.on('end', function (data) { | |
context.log("done creating index.html"); | |
uploadSite(pageFile); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment