Skip to content

Instantly share code, notes, and snippets.

Created December 16, 2011 04:51
Show Gist options
  • Save anonymous/1484531 to your computer and use it in GitHub Desktop.
Save anonymous/1484531 to your computer and use it in GitHub Desktop.
Rendering
// require hogan
var hogan = require("hogan");
// compile template
var template = hogan.compile("Follow @{{bro}}!");
var bros = ['dhg', 'fat', 'sayrer'].map(function (bro) {
// Render context to template
return template.render({ bro: name });
});
// outputs "Follow @fat! Follow @dhg! Follow @sayrer!"
console.log(bros.join(' '));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment