Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2018 11:50
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment